I hate dealing with regexps under JavaScript.  What I typically do is 
have to reference the JScript manual on MSDN every time I do something 
with them ...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/js56jsoriJscript.asp

Regexp syntax:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/js56jsgrpregexpsyntax.asp

Of course, you could also try:

www.irt.org - check out their JavaScript FAQ (scroll down a little)

Do you need to escape the space/- maybe?

( | -) to (\ |\-)     ???

It looks like you want to make it optional too:

( | -) to (\ |\-)?     ???

Darren Hill wrote:

>I suck.
>
>I'm trying to come up with a reg expr for a Canadian Postal Code
>(ie. M6P 3G6 .. or .. M6P3G6 )
>
>I've got ...
>
><constant name="zip" value="^([A-Za-z]\d[A-Za-z]( |-)\d[A-Za-z]\d)$" />
>
>IS THIS NOT RIGHT?
>
>Darren.
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>

-- 
Eddie Bush




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to