Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

nodejs check if string matches regex

console.log(/^([a-z0-9]{5,})$/.test('abc1')); // false

console.log(/^([a-z0-9]{5,})$/.test('abc12')); // true

console.log(/^([a-z0-9]{5,})$/.test('abc123')); // true
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #nodejs #check #string #matches #regex
ADD COMMENT
Topic
Name
5+3 =