in reply to Using previous match in the same matching regexp (now with newlines!)
my ($len,$substring) = ($string =~ /^(\d+) ((??{"(?s).{$1}"}))/s);
See perlre on (?imsx-imsx).
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using previous match in the same matching regexp (now with newlines!)
by cyberconte (Scribe) on Nov 18, 2005 at 16:51 UTC |