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
Post a Comment