XP is just a number | |
PerlMonks |
Re: Testing a string for a range of charactersby Albannach (Monsignor) |
on Jan 24, 2001 at 21:12 UTC ( [id://54045]=note: print w/replies, xml ) | Need Help?? |
Just another WTDI:
which gives the surprisingly (to me) competitive result: I also tested a couple of variations: regex2 - used [A-Z] in place of [A..Z] as I've never used the latter before and can't even figure what it would do at the moment regex3 - omitted the ^ and $, which violated the spec but I wanted to know index2 - similarly omitted the length() call Update: Benchmarks run on NT4 PIII-500 w/256MB RAM, Perl 5.6.0, ActiveState build 618 --
In Section
Seekers of Perl Wisdom
|
|