preg_replace question???
Posted: Sat Dec 10, 2005 4:16 pm
I have the following code:
I am using preg_replace()
I am trying to use the ABOVE regex to localize the second parameter of a funciton call...and replace the string text, but I"m not sure this is possible without rewritting the entire function call???
Note: param1 is fixed and my only concern is to locate the text in between (.+) and replace ONLY it with another variable...
Is this possible or do I have to rewrite the entire function call...basically everythiing which i've matched with teh above regex???
Cheers
Code: Select all
func_name\('param1'\s*,\s*'(.+)'\)I am trying to use the ABOVE regex to localize the second parameter of a funciton call...and replace the string text, but I"m not sure this is possible without rewritting the entire function call???
Note: param1 is fixed and my only concern is to locate the text in between (.+) and replace ONLY it with another variable...
Is this possible or do I have to rewrite the entire function call...basically everythiing which i've matched with teh above regex???
Cheers