in reply to Stripping out specific numbers

What have you tried?

perlrequick

This will capture.

if( $string =~ m/(?<!\d)(\d{4,5})(?!\d)/ ) { print "$1\n"; }

If you want to capture all occurrences:

my( @found ) = $string =~ m/(?<!\d)(\d{4,5})(?!\d)/g;

And if "strip" means remove:

$string =~ s/(?<!\d)\d{4,5}(?!\d)//g;

Dave