javascript - RegEx expression -



javascript - RegEx expression -

i'm using javascript , grateful pattern matches 1 through 6 digits followed optional .nn.

so, in end i'd have function returns true strings match patterns these:

nn nnn nn.nn nnnnn.nn nnnn nnnnnn.nn nnnnnn

(where n digit).

thanks!!

you can /^\d{1,6}(.\d\d)?$/ js like:

/^\d{1,6}(\.\d\d)?$/.test(str)

javascript regex

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -