cyberconte has asked for the wisdom of the Perl Monks concerning the following question:
I found that adding the newline broke the following answer:my $string = "16 abc\ndefghijklmnopqrstuvwxyz";
I did some reading up on the experimental postponed regexp, but it doesn't look like theres a '/s' equivilant for the postponed section.my ($len,$substring) = ($string =~ /^(\d+) ((??{".{$1}"}))/s);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using previous match in the same matching regexp (now with newlines!)
by Aristotle (Chancellor) on Nov 18, 2005 at 15:50 UTC | |
by cyberconte (Scribe) on Nov 18, 2005 at 16:51 UTC |