Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

regex for numbers + dot in javascript

// javascript regex for numbers and dot ex : 2.2
function validate(s) {
    var rgx = /^[0-9]*.?[0-9]*$/;
    return s.match(rgx);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #regex #numbers #dot #javascript
ADD COMMENT
Topic
Name
8+1 =