in reply to Regular expression modifiers in a scalar
The problem seems to be that $modifiers is not interpolated in time for the compiled regex to have seen it. This will work,
That is a facet of "Cloistered Pattern Modifiers", as covered on p186 of the Camel Book(3ed.).if ( $text =~ m/(?$modifiers)$pattern/ ) { print "it matches\n"; }
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regular expression modifiers in a scalar
by wintermte (Initiate) on Jul 24, 2006 at 12:21 UTC |