in reply to RegEx for parsing wiki enumeration
It would have been a good idea to post your script or a relevant part of it here so that we might see where to fit it in. Now you have to see for yourself how this might fit in with your code
my $ennumerate=0; ... #you probably have a loop like this in your script? while ($line=<$fh>) { #insert this into the loop: if ($ennumerate==1) { if ($line=~/^#(.*)/) { print "\\item $1\n"; } else { $ennumerate=0; print "\\end{enumerate}\n"; } else { if ($line=~/^#(.*)/) { print "\\begin{enumerate}\n"; print "\\item $1"; $ennumerate=1; } } ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: RegEx for parsing wiki enumeration
by raymontag (Initiate) on Apr 06, 2011 at 15:53 UTC |