Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: regex help

by jethro (Monsignor)
on Oct 05, 2013 at 20:06 UTC ( #1057077=note: print w/replies, xml ) Need Help??


in reply to regex help

Another solution, with only one regex:

m/\d[a-zA-Z]|[a-zA-Z]\d/;

This works because in a string with both letters and numbers there has to be at least one location where a letter and a number touch

Update: To Laurent_R: Absolutely. Clarity and simplicity always wins. Except when this line is in the 3% of code that needs 99,7% of the runtime of a program and you have to optimise for speed

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1057077]
help
Chatterbox?
[karlgoethebier]: good day
[Corion]: Hi all ;)
[marto]: hey Corion, how's tricks?

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2017-07-26 10:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (390 votes). Check out past polls.