Help with a regex - Not containing a string
Posted: Tue Mar 01, 2011 6:14 pm
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-)][.]*)["\']#'
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-)][.]*)["\']#'