use strict;
my $str = 'Mary had a little lamb 1980750ml
Mary had a little lamb 2087750ml
Mary had a little lamb 1979750ml
Mary had a little lamb 1980750ml
Test 19819ml
Test 198218ml
Test 2123456ml
Test 20349876ml
Test 209912345ml
Test 1999123456ml
Test 987654321ml
Test 1988ml
Test 9999ml
Test 2000ml
Test 100ml
Test 22ml
Test 9ml
Test ml
';
my $regex = qr/(?:190[0-9]|19[1-9][0-9]|2[01][0-9]{2})(?=\d*ml)(*SKIP)(*FAIL)|\d{1,5}ml/mp;
my $subst = '';
my $result = $str =~ s/$regex/$subst/rg;
print "The result of the substitution is' $result\n";
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Perl, please visit: http://perldoc.perl.org/perlre.html