in reply to Re^4: Regex conditional match if previous match in same expression is true?
in thread Regex conditional match if previous match in same expression is true?
Rhandom provided a better solution. Here's a simplification of it:
/ (?: ({) | (?<!{) ) hello (?(1) } | (?!}) ) /x
It doesn't "use Perl", but I suspect it won't solve your compatibility problems like you think it will. Are you sure that engine supports conditionals ((?(...)...|...))?
I've never read "Mastering Regular Expressions".
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Regex conditional match if previous match in same expression is true?
by radiantmatrix (Parson) on Apr 23, 2007 at 14:25 UTC |