-Markmy $string = ''; # output string open FILE, "<file.txt" or die "Could not open file.txt: $!"; while (<FILE>) { chomp; s/^N\d+ //; # strip line numbers if (/^\*/) { # comment s/^\*/!/; $string .= $_; } else { # other while ($_ =~ /[x-z]/([\d.+-]+)/ig) { $string .= " $1"; } } } print $string;
In reply to Re: regular expression help
by kvale
in thread regular expression help
by airblaine
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |