|
|
| go ahead... be a heretic | |
| PerlMonks |
Re: Regular expressionsby cees (Curate) |
| on Apr 13, 2005 at 09:43 UTC ( [id://447377]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
You already have some good answers, but here is another that just reverses your search (ie instead of searching for a-zA-Z it searches for anything that is not a-zA-Z and negates the answer):
This will return false if it finds a character that is not a-z or A-Z. The [^ ] only matches if none of the characters contained in the brackets are found. You could reverse your condition to make the code easier to read with this method:
- Cees
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||