I’m using netbeans and I want to wrap $this->escape(stuff) around specific stuff in more files, using the replace feature, but there’s plenty of conditions, like:
match:
$this->$variable, $variable
$this->$array['something'], $this->$array[0], $array['something'], $array[0]
do not match:
$this->partial, $this->escape, $this->form
What I have so far that works ok
replace this
echo\s+(\$this->[->a-zA-Z_']+[^\s;(])
with this
echo \$this->escape\($1\)
It doesn’t work with arrays and doesn’t exclude anything, also doesn’t match $variable
Could anyone help out, improve the expression so that it would reduce the torture of going through so many strings by hand? Any help is appreciated.
edit: just adding the exclusions to my working example would be enough.
It’s not entirely clear what parts you’re trying to match. If I understood you correctly then this should work:
If you meant to match something else, please let me know.