Hi I suck with regex - please help.
Need to parse a HTML document for script tags. Within these script tags, I need to match Javascript legal forms of the following:
document.form.action = "/some/URL";
but where "some/URL" does NOT START with "/FOO-"
So, I should match:
document.form.action="someother/URL";
AND
document.form.action = "someother/URL/1/2/3jhkj" ;
AND
document.form.action=
"someother/URL";
I also need a reference to the URL "/some/URL" because I need to encrypt it...
I have tried:
'#(document\.form\.action)[\s]*=[\s]*["\']([^(/FOO-)][.]*)["\']#'
Help with a regex - Not containing a string
Moderator: General Moderators
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Help with a regex - Not containing a string
This should work:
[text]'#document\.form\.action[\s]*=[\s]*["\'](?!/FOO-)([^"\']+)["\']#'[/text]
[text]'#document\.form\.action[\s]*=[\s]*["\'](?!/FOO-)([^"\']+)["\']#'[/text]
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.