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 -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -