in reply to Re: Split a string at a given line number
in thread Split a string at a given line number
Hi thanks for that. I've tested it and I can't seem to get that to work. At the moment my code for it looks like this:
my @chunks = ($string =~ /(?|(?:((?:[^\n]*\n){19}[^\n]*)\n)|((?s:.*))) +/g); print Dumper @chunks[0];
That returns the message:
Sequence (?|...) not recognized in regex; marked by <-- HERE in m/(?| + <-- HERE (?:((?:[^\n]*\n){19}[^\n]*)\n)|((?s:.*)))/.
Wouldn't know where to start with fixing that I'm afraid.
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Split a string at a given line number
by JavaFan (Canon) on May 12, 2010 at 12:50 UTC | |
by danj35 (Sexton) on May 12, 2010 at 12:58 UTC | |
by AnomalousMonk (Archbishop) on May 12, 2010 at 16:11 UTC | |
by JavaFan (Canon) on May 12, 2010 at 13:11 UTC |