Answers for "check if character matches regex javascriptalphanumeric"

2

regex to check if string contains special characters javascript

var format = /[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/;
//            ^                                       ^   
document.write(format.test("My@string-with(some%text)") + "<br/>");    //true
document.write(format.test("My string with spaces") + "<br/>");        //true 
document.write(format.test("MyStringContainingNoSpecialChars"));       //false
Posted by: Guest on July-05-2020
1

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
Posted by: Guest on August-06-2021

Code answers related to "check if character matches regex javascriptalphanumeric"

Code answers related to "Javascript"

Browse Popular Code Answers by Language