|
|
| Do you know where your variables are? | |
| PerlMonks |
Re: regex: only want [a-zA-Z] and comma chars in a stringby delirium (Chaplain) |
| on Oct 12, 2003 at 20:56 UTC ( [id://298710]=note: print w/replies, xml ) | Need Help?? |
|
If you're new to regexes, it might be helpful (although it will slow down processing slightly) to break this down into each thing you are trying to test. That may help you later when coming back to the code to figure out what you were testing for.
For example: print "$_\n" if !/^,/ && !/,$/ && !/,,/ && /^[a-zA-Z,]$/;
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||