in reply to Parsing using Regex and Lookahead
While you are on the subject of lookaheads, this
$code =~ s/\n//g; #remove all the newlines $code .= "\n"; #add one to the end
could be replaced by this
$code =~ s/\n(?=.)//g # remove all but the last newline
I hope this is of interest.
Cheers,
JohnGG
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Recursive Regex
by JavaFan (Canon) on Mar 11, 2009 at 11:09 UTC | |
by johngg (Canon) on Mar 11, 2009 at 11:44 UTC | |
| |
by deMize (Monk) on Mar 11, 2009 at 17:21 UTC | |
by furry_marmot (Pilgrim) on Mar 19, 2009 at 20:36 UTC |