in reply to Re: Re: Re: Regex "(un)Knowledge"
in thread Regex "(un)Knowledge"
So, you are slurping the whole file as a scalar and matching against that. The problem with that is, you have effectively told perl that there are no such things as lines, so $. isn't going to help. It will always be 1.
The only thought that comes to mind is build an index to the relate newlines to byte positions. Then use @+ (See perlvar) to get the byte positions at which each element of your array of captures was found and look these up in the index to convert the byte positions back to line positions.
Not nice, but it would work.
|
|---|