My continuing problem with regular expressions!
All I am trying to get is the expression must have at least 1 of these [a-z][0-9] in any order etc etc
Can anyone help?
thisdidn't workCode:RegExp(/[a-z][0-9]/)
Thanks
Sarah
| SitePoint Sponsor |
My continuing problem with regular expressions!
All I am trying to get is the expression must have at least 1 of these [a-z][0-9] in any order etc etc
Can anyone help?
thisdidn't workCode:RegExp(/[a-z][0-9]/)
Thanks
Sarah
Regular user
Still a bit vague, I'm afraid. Do mean you want a letter followed by a digit, and that any number of times? Like a7c6y3?at least 1 of these [a-z][0-9] in any order
In that case the regex
would do the trick.Code:RegExp(/([a-z][0-9])+/)
But maybe you just want any sequence of one or more alphanumeric characters, like aabx83cq9.
Then the regex
is more appropriate.Code:RegExp(/[a-z0-9]+/)
Hope this helps.
"A poor programmer is he who blames his tools."
http://analyser.oli.tudelft.nl/
second one was perfect thank you
I was so close and yet SO far
Sarah
Regular user
thanks beetle bed time reading - don't think that was one I read before so thank you.
Sarah
Regular user
Bookmarks