Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: regex: only want [a-zA-Z] and comma chars in a string

by Anonymous Monk
on Oct 12, 2003 at 17:27 UTC ( [id://298674]=note: print w/replies, xml ) Need Help??


in reply to regex: only want [a-zA-Z] and comma chars in a string

@strings = ("notalot", "england,rugby" , "chicken,egg,duck,feet" , ",southampton" , "bristol," , "iran, canada,france" , "" , ); for (@strings) { print "$_\n" if /^[a-zA-Z]([a-zA-Z]+|,(?!,|$))*$/; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://298674]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2024-04-20 06:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found