dickey
New Member
- Messages
- 128
- Reaction score
- 0
- Points
- 0
hi
I have this regular expression in php using preg_replace...
anyway to keep it short it matches...
"This is a string".z()
and
"Another string".z()
but it unfortunately matches...
"GET: "http://this.url.com/".z()
when I want it to only match "http://this.url.com/".z();
I am new to creating my own regex and want to resort to
doing
\"[a-zA-Z0-9\D]*\"\.z\(\)
or is there a better way...
My objective is to create a regex that matches a string enclosed within double quotes followed that is passed to a function z() in javascript. The source string is also pre-processed to replace any escaped quotes inside the string.
I have this regular expression in php using preg_replace...
PHP:
preg_match("/\"\w+\"\.z\(\)/", $string, $matches);
anyway to keep it short it matches...
"This is a string".z()
and
"Another string".z()
but it unfortunately matches...
"GET: "http://this.url.com/".z()
when I want it to only match "http://this.url.com/".z();
I am new to creating my own regex and want to resort to
doing
\"[a-zA-Z0-9\D]*\"\.z\(\)
or is there a better way...
My objective is to create a regex that matches a string enclosed within double quotes followed that is passed to a function z() in javascript. The source string is also pre-processed to replace any escaped quotes inside the string.