Answers for "regex for numbers + dot in javascript"

0

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);
}
Posted by: Guest on August-31-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language