Use this regex it will work
var regex = /^\d{5}\.\d{2}$/;
var num = '23445.09';
console.log(regex.test(num)); // True
var num2 = '12345.6'
console.log(regex.test(num)); // False
More Related Contents:
- Remove text between two parenthesis, if two more parenthesis [closed]
- Need Pattern for password field?
- Is there a RegExp.escape function in JavaScript?
- How do you use a variable in a regular expression?
- How can I parse a CSV string with JavaScript, which contains comma in data?
- Replace multiple strings with multiple other strings
- How can I extract a number from a string in JavaScript?
- Check whether a string matches a regex in JS
- Split a string by commas but ignore commas within double-quotes using Javascript
- Extract hostname name from string
- Matching a Forward Slash with a regex
- How to find a number in a string using JavaScript?
- How can I concatenate regex literals in JavaScript?
- escaping question mark in regex javascript
- Javascript regex (negative) lookbehind not working in firefox
- JavaScript/regex: Remove text between parentheses
- JavaScript Regex, where to use escape characters?
- javascript regex for password containing at least 8 characters, 1 number, 1 upper and 1 lowercase [duplicate]
- JavaScript Regular Expression Email Validation [duplicate]
- Extract image src from a string
- how to extract floating numbers from strings in javascript
- How to prevent invalid characters from being typed into input fields
- How to convert “camelCase” to “Camel Case”?
- Regex for parsing single key: values out of JSON in Javascript
- What’s the correct regex range for javascript’s regexes to match all the non word characters in any script?
- javascript split string by space, but ignore space in quotes (notice not to split by the colon too)
- Mask US phone number string with JavaScript
- JavaScript remove ZERO WIDTH SPACE (unicode 8203) from string
- Regex – Repeating Capturing Group
- How do you split a javascript string by spaces and punctuation?