Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RegEx and JScript 1

Status
Not open for further replies.

Sarky78

Programmer
Oct 19, 2000
878
GB
Hi

I'm having problems with a RegEx within a JScript site. I know this RegEx works as I've used it in other languages, but it refuses to do it within jscript.

Any one got any ideas?

Code:
	var myRegEx = new RegExp("[A-Z]{1,2}\d","gi");
	Response.write(myRegEx.test(String("WR12")));

This is a regex to check an outcode of a uk postcode, and the above is a valid outcode, but it returns false all of the time.

Any ideas?

Thanks

Tony
 
> var myRegEx = new RegExp("[A-Z]{1,2}\d","gi");
[tt] var myRegEx = new RegExp("[A-Z]{1,2}[red]\\[/red]d","gi");[/tt]
 
Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you!

Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top