in reply to Re^2: Regex to match range of characters broken by dashes
in thread Regex to match range of characters broken by dashes
This is a bug that was corrected in Perl version 5.18 IIRC. With this correction, lexical variables always work as expected in "(?{ code })" and "(??{ code })" regex constructs.
I wasn't aware of that bug. And your local our $q = $s - 1; fixes that.
it can all be written normally, given that the s/// match regex is, by default, re-compiled on each s/// execution
That is a nice solution! The (??{. . .}) construct wasn't necessary.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Regex to match range of characters broken by dashes
by AnomalousMonk (Archbishop) on Jul 18, 2016 at 04:07 UTC |