Regex help
Posted: Tue Mar 04, 2003 4:53 pm
I'm having serious trouble getting a regular expression to work and would greatly appreciate any help.
I basically want to do stripslashes() on text in a string where it is between a {php} and {/php} tag.
A couple of things I've tried so far:
Hopefully someone who understands regular expression better than me will have an answer 
I basically want to do stripslashes() on text in a string where it is between a {php} and {/php} tag.
A couple of things I've tried so far:
Code: Select all
$tmpl = preg_replace("!\{php\}(.|\s)+\{/php\}!e", "stripslashes('\\1')", $tmpl);
$tmpl = preg_replace( "!\{php\}(ї^{]+)\{/php\}!e", "{php} stripslashes( '$1' ) {/php}", $tmpl );