in reply to Re: Dynamic regex assertions, capturing groups, and parsers: joy and terror
in thread Dynamic regex assertions, capturing groups, and parsers: joy and terror
The result of (??{ print $1 }) is 1 because print() succeeded in writing to STDOUT. The regex that was then compiled by (??{ ...}) was "1" which then failed. So the (.) advanced over every character and printed them individually. The proper thing to do here would have been (?{ ... }) which will not affect regex matching.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Dynamic regex assertions, capturing groups, and parsers: joy and terror
by demerphq (Chancellor) on Oct 04, 2005 at 09:13 UTC |