Yes, this approach has some limitations, the most severe being that tr/// doesn't perform variable interpolation. It's still nice to know.my $good = "abcde"; my $bad = "zyxwv"; my $mixed = "azby"; for ($good, $bad, $mixed) { print "$_ contains invalid characters!\n" if tr/a-m//c; }
In reply to Re: Some sexy regex
by chromatic
in thread Some sexy regex
by Martin A
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |