Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Stumped by regex

by themage (Friar)
on Dec 06, 2006 at 15:01 UTC ( #588100=note: print w/ replies, xml ) Need Help??


in reply to Stumped by regex

Hi brickwall,

I think this would do what you want:

m{\A[a-zA-Z][a-zA-Z\s]{0,18}[a-zA-Z]\Z} and (@a=m{\s}g)<=1
The first regexp makes sure that you have at least two chars and up to 20, including spaces.

That after and make sure that you have at most a space.

TheMage
Talking Web


Comment on Re: Stumped by regex
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (11)
As of 2015-07-31 08:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (275 votes), past polls