It only accepts the pair "+-", not individual +'s or -'s. Easier with a character class:It fails to match with a leading +, which I haven't got to the bottom of yet, but rejects all the wrong strings.if ($string =~/^(?:Ext|\d|\)|\(|\.|\s|\+\-)+$/i)
if ($string =~/^(?:Ext|[-.+()\d\s])+$/i)
In reply to Re^4: Tweak for my Perl Regex that screens for digits only
by ysth
in thread Tweak for my Perl Regex that screens for digits only
by hackermike
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |