PHPMYADMIN Syntax for find and replace with single and double quotes - replace

Can someone help me understand why I am getting a syntax error for this PHPMyAdmin query? A developer did a find and replace for window popups and it truncated the replacement on hundreds of pages to 'onclick="return false;"' by mistake. Full code needed in in the replacement field below.
UPDATE `r61bq_content` SET `introtext` = replace(introtext, 'onclick="return false;"', 'onclick="window.open(this.href, \'\', \'resizable=no,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=no,dependent=no,width=500,height=50\'); return false;"')
thanks in advance!

I was able to do it with the PHPMyAdmin find and replace:
onclick="window.open(this.href,\'\', \'resizable=no,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=no,dependent=no,width=500,height=50\'); return false;"
if anyone needs to know.

Related

Vim. Use matchpairs option for jumping between start and end of spanish questions marks

Just as title says, I want matchpairs option to work with with the signs '¿' and '?'. It works with other signs, for example after setting:
I'm able to jump between spanish exclamation marks ('¡' and '!') with just pressing '%'. The problem comes when doing the same with questions marks by:'
I will obtain a error message explaining some kind of function failing dealing with regex:
At first sight, the function would seem to come from one of my plugins so I tried to find which by replacing my .vimrc with a blank file but vim continued showing the same error so my personal plugins are not the problem.
As far as I know, when using nocompatible mode in vim several integrated plugins are charged. I think some of those plugins is the guilty, because when I call vim without any config fail by "vim -u NONE" the problem disappears. However, anyone here would be with me in that using no config file would be a little unpleasant.
Then my questions are:
What is the easiest way to solve this problem?
What is causing it? Is really something related with regular expressions (I have tried placing a '\' before the '?' without results)'?
You could use matchit plugin (which most likely is already installed in your computer as the function causing the error, Match_wrapper(), is defined on matchit.vim. To check if matchit.vim is loaded, use the command :scriptnames in Vim). Then add this auto command to .vimrc:
autocmd! BufWinEnter,BufEnter * if exists("b:match_words") |
\ let b:match_words=b:match_words.',¿:?' |
\ endif
To keep .vimrc clean you may want to follow the advice on help :matchit:
... you can add autocommands to the script or to your vimrc file, but the recommended method is to add a line such as
let b:match_words = '\<foo\>:\<bar\>'
to the filetype-plugin for your language.

Notepad++ Find/Replace Wildcard problems

Hopefully this is simple because I can't seem to figure it out.
I have a game that outputs a log with information I'd like to review, but it's bogged with tags.
<color=#9B9B9BFF>abndnd_b9o66v</color>.<color=#1EFF00FF>out_ys0a67</color>
<color=#9B9B9BFF>uknown_ospiw8</color>.<color=#1EFF00FF>p_vyuxzb</color>
<color=#9B9B9BFF>anonymous_yzgoqq</color>.<color=#1EFF00FF>pub_info_o1rotu</color>
<color=#9B9B9BFF>unidentified_t7stef</color>.<color=#1EFF00FF>out_gems04</color>
<color=#9B9B9BFF>abndnd_5vs06o</color>.<color=#1EFF00FF>public_7gshh2</color>
<color=#9B9B9BFF>anon_7kq2k4</color>.<color=#1EFF00FF>pub_wxn46t</color>
<color=#9B9B9BFF>anon_i83kkg</color>.<color=#1EFF00FF>info_ev39gs</color>
I can simply filter it by hand, but I know a regex may be able to help, I just can't seem to figure out the syntax correctly and how to trim the tags without tampering with the needed text
and my end result I'm trying to get is this:
abndnd_b9o66v.out_ys0a67
uknown_ospiw8.p_vyuxzb
anonymous_yzgoqq.pub_info_o1rotu
unidentified_t7stef.out_gems04
abndnd_5vs06o.public_7gshh2
anon_7kq2k4.pub_wxn46t
anon_i83kkg.info_ev39gs
Try this:
<color=.*?>(.*?)</color>\.<color=.*?>(.*?)</color>
Replace by this:
\1\.\2

sharepoint 2013 web part generates broken javascript like &apos;function&apos; on home page

My homepage generate invalid javascript code, so it throws javascript error and other JS functions dont work;
Code is;
if(typeof(MSOLayout_MakeInvisibleIfEmpty) == &apos;function&apos;) {
MSOLayout_MakeInvisibleIfEmpty();
}
As you see error is : &apos;function&apos;
it must be "function"
how do i fix it?
I'm guessing your trying to hide empty web part zones and copied and pasted the following code:
if(typeof(MSOLayout_MakeInvisibleIfEmpty) == "function") {
MSOLayout_MakeInvisibleIfEmpty();
}
Here are a couple of things to try to fix your issue.
Make sure that the pasted code includes the double quotes and not the &apos; that might have been carried over when you copied and pasted it. If you see &apos; in your code, replace it with actually typing the double quote (").
If it shows as double quotes in the master page (or .html file of the master page) try deleting them and retyping them. It is possible they appear as double quotes but are actually being generated through your text editor and still &apos; behind the scenes.
Hope this helps!

regular expression to parse image url from a html code

Hello guys i wrote a module that creates some articles and css them properly and i want to parse the images from the Article content. The first thought came to my mind was the regular expressions. i didnt have any idea till 3 hours i started reading tutorials about regexp and i made a pattern that for me it seems kinda ok.
$pattern='^src\="images\/([a-zA-Z]+|[0-9]+)+([a-zA-Z]*|[0-9]*)*\.[jpg|png|bmp|gif]"$';
$regstring=$introtext;
preg_match($pattern,$regstring,$matches);
var_dump($matches);
INPUT:
<p>ASDADSDSASADSADSASDADSDSASADSADSASDADSDSASA</p>
<p><img src="images/authentic.jpg" alt="authentic" /></p>
<p>SASDADSDSASADSADSASDADSDSASADSADS</p>
I kinda found alot of ready patters in stackoverflow that are completly different than mine, and i didnt want to just copy some lines that i dont know what they do.Also i found out ten mins before that i can do that With DOM html , but im stubborn to make it work with regexpr so i can learn something more about it.
Can someone help me find what is my mistake/s ?
Thanks for your time.
src="images\/[a-zA-Z0-9]+\.(?:jpg|png|bmp|gif)"
You can try this.A simple version of your regex.See demo.
http://regex101.com/r/oE6jJ1/36
$pattern='/(?<=[\'\"])[\w\/-]+[.]{1}[a-zA-Z]{3,4}(?=[\'\"])/i';
$regstring=$introtext;
preg_match_all($pattern,$regstring,$matches);
var_dump($matches[0]);
you can see how this works here: http://regex101.com/r/eV6gE4/1
Use a proper solution, and please, stop killing kitties (every-time you try to parse HTML with regex, you kill a kittie) when you install perl module WWW::Mechanize, the command mech-dump become available :
$ mech-dump --images http://stackoverflow.com/questions/27151348
http://i.stack.imgur.com/qF63b.jpg?s=32&g=1
//cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png
http://i.stack.imgur.com/nyAHT.jpg?s=32&g=1
/posts/27151348/ivc/677a
http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif

Yahoo Pipes Using Regex to change link

Hi I am pretty new to regex I can do some basic functions but having trouble with this. I need to change the link in the rss feed.
I have a url like this:
http://mysite.test/Search/PropDetail.aspx?id=38464&id=38464&listingid=129-2-6430678&searchID=250554873&ResultsType=SearchResult
and want to change it to updated site:
http://mysite.test/PropertyDetail/?id=38464&id=38464&listingid=129-2-6430678&searchID=250554873&ResultsType=SearchResult
Where only thing changed is from /Search/PropDetail.aspx
to /PropertyDetail/
I don't have access to the orginal rss feed or I would change it there so I have to use pipes. Please help, Thanks!
Use the regex control.
In it, specify the DOM address of the node containing your link (prefixed by "item.") within the "In" field. For the "replace" field type
(.*)//Search//PropDetail/.aspx
and in the "with" field type use:
$1//PropertyDetail//.*
I've 'escaped' the '/' character in the with field. However, I'm not sure you need to do this except before the '.*' Some trial and error may be needed.
Hopefully this will achieve the result you want.