Search
 
SCRIPT & CODE EXAMPLE
 

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");
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: router.push in vue 3 
Javascript :: javascript get child element by parent id 
Javascript :: html close tab 
Javascript :: image upload react 
Javascript :: byte to mb js 
Javascript :: how to change background color on scroll 
Javascript :: js double exclamation mark 
Javascript :: move canvas element to mouse 
Javascript :: check if isset variable js 
Javascript :: js object using variable as key 
Javascript :: how to access curl data in javascript 
Javascript :: random number generator javascript with range 
Javascript :: how to use uniqid 
Javascript :: multiple case switch javascript 
Javascript :: on load page javascript 
Javascript :: antd dropdown stop propogation 
Javascript :: preload 
Javascript :: javascript creeate utc date 
Javascript :: sort strings javascript alphabetically 
Javascript :: run onclick function once javascript 
Javascript :: file upload javascript 
Javascript :: javascript get last object in foreach loop 
Javascript :: sort js 
Javascript :: window.addeventlistener 
Javascript :: vscode 
Javascript :: socket io emit to socket id 
Javascript :: node js run for loop asynchronously 
Javascript :: MongoDb user find 
Javascript :: length of set javascript 
Javascript :: react compress image 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =