XP is just a number | |
PerlMonks |
regex to deny characters?by arrow (Friar) |
on Dec 06, 2002 at 21:18 UTC ( [id://218154]=perlquestion: print w/replies, xml ) | Need Help?? |
arrow has asked for the wisdom of the Perl Monks concerning the following question:
I've been trying for a while now to simply (or not so simply) construct a regex to deny any characters others than lowercase letters, hyphens, and spaces. Simple, no? NO! I've tried every combination I could think of including making to match statments, one to try to match the lowercase letters, hypens, and spaces, and one to match all the characters I didn't want. Here are some of my desperate attempts: /[a-z]+(?:[a-z\s-] *)/ (current) /[a-z]+[-\s]*/ /[-\s(a-z)+]*/ but obviously none of them have worked. Any suggestions? P.S. Thanks jwest for giving me the first one. Edit by tye, change title, close CENTER tag
Back to
Seekers of Perl Wisdom
|
|