...

View Full Version : REGULAR EXPRESSION HELP... is this correct?



BrightNail
08-01-2006, 10:01 PM
I want to see if a condition matches the following..


var countryMatch = /^['(149|14|163)']$/ ;

is that the right way to test for THOSE THREE ITEMS : 149, 14, 163 ???

ala..

somecountry.match(countryMatch)

Want to know if that reg ex up top is correct... those are numbers..

please advise..

Philip M
08-01-2006, 10:52 PM
if (/^149|14|163$/g.test(countryMatch.value)) {

returns true if the field contains 149 or 14 or 163 and nothing else.

BrightNail
08-01-2006, 11:41 PM
thanks, totally appreciate it.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum