What's with "\s*?"? Don't you simply mean "\s*"?
Anyway,
s/ (?<!_) ( split \s* \( \s* ) ( " (?:[^\\"]+|\\.)* " | ' (?:[^\\']+|\\.)* ' ) / my @x = ($1,$2); $x[1] =~ s{/}{\\/}g; "preg_$x[0]$x[1]" /xesg
Untested.
Will create an error if the "/" is already escaped.
In reply to Re: regex escaping forward slash in regex
by ikegami
in thread regex escaping forward slash in regex
by gilemon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |