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
In reply to Re: Recursive Regex
by johngg
in thread Parsing using Regex and Lookahead
by deMize
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |