There is no concept of nearly matching with regular expressions, but you could match each part conditionally and see how many are missing:
- Code: Select all
$string ='LPSTEOPRTRYERTRETR';
@mat = $string =~ /^(LP)?([SKTAQEHLDN])?([TA])?([GN])?([EDASTV])?/;
$count = grep(/^$/,@mat);
print ("$count missing element(s)\n");
--
Graham