The !~ binding returns true for non-matches,
or to keep the important part first and the match positive,$reference = '' if $reference !~ m/38[0-9]{8}[A-Z]{3}/;
$reference =~ m/38[0-9]{8}[A-Z]{3}/ or $reference = '';
After Compline,
Zaxo
In reply to Re: Regex 'If Not Match'
by Zaxo
in thread Regex 'If Not Match'
by PugSA
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |