Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

check if string matches regex js

var term = "sample1";
var re = new RegExp("^([a-z0-9]{5,})$");
if (re.test(term)) {
    console.log("Valid");
} else {
    console.log("Invalid");
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #string #matches #regex #js
ADD COMMENT
Topic
Name
9+4 =