"Noozer" <do*******@me.here> wrote in message
news:o0tye.1867503$Xk.369504@pd7tw3no...
I have a variable named "acct". I first want to remove any "-" characters
from it's value. After this I want to verify that we have only exactly 12
digits in the variable.
Unfortunately I'm pretty green as far as using RegEx.
/\d{12}/.test(acct); should do the second part, but how do I do the
first?
Actually figured out what I needed:
f.Acct.value =
f.Acct.value.replace(/^(\d{4})-?(\d{4})-?(\d{4})$/,'$1$2$3');
BUT, now I need to go the other way...
Assuming that my variable acct contains "123456789012" what expression do I
use to get "1234-5678-9012"
???