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

08-01-2006, 09: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 ???



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

please advise..

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

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

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

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum