http://www.perlmonks.org?node_id=491929


in reply to Re: Between START .. END
in thread Between START .. END

Here's a regex that would do the trick.

#!/usr/bin/perl -w use strict; while (<DATA>) { $_ =~ tr/!@#$%^&*//d; # will you encounter funky chars? next unless ($_ =~/(^\d+)/); print $_; } __DATA__ START 1 2 3! 4 5 END START 1* 2 3 4 5 6 END