print "Enter a string (enter quit or [CTRL]-D to quit): "; while(<>) { $line = $_; last if ($_ =~ /^\s*quit\s*$/i); next if ($_ =~ /^\s~*$/); if($line =~ /\s*[a-zA-Z\s]+\s*-?\d+\s*/) { print $_; } }
In reply to Re: New to perl and regex
by Utilitarian
in thread New to perl and regex
by MarvC
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |