in reply to Some sexy regex
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; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Some sexy regex
by parv (Parson) on Mar 19, 2003 at 08:04 UTC |