In your last code snippet I think the ... "_ear" eq substr $_, -3; is only going to look at the last three characters so the condition will never be true.
$ perl -le ' $str = q{bit_of_a_pigs_ear}; print q{_ear} eq substr( $str, -3 ) ? q{Match found} : q{No match}; print q{_ear} eq substr( $str, -4 ) ? q{Match found} : q{No match};' No match Match found
I hope this is of interest.
Cheers,
JohnGG
In reply to Re^2: Help with form validation regex
by johngg
in thread Help with form validation regex
by perlnewb123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |