Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

regex special characters javascript

var regex = /^[a-zA-Z0-9!@#$%^&*)(+=._-]+$/g
Comment

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
Comment

PREVIOUS NEXT
Code Example
Javascript :: iis express gzip 
Javascript :: react firebase add doc to collection 
Javascript :: how to filter multiple values from a json api 
Javascript :: switch into the postgres user windows 10 
Javascript :: universal mobile number regex 
Javascript :: extends in js 
Javascript :: javascript redirect to file 
Javascript :: google drive show size folder 
Javascript :: js queryselectorall 
Javascript :: js extract boolean from string 
Javascript :: angular generate validator 
Javascript :: javascript append list to list 
Javascript :: javascript sanitize html 
Javascript :: arguments object in javascript 
Javascript :: how to use react fragment 
Javascript :: appendchild element once if element present in js 
Javascript :: javascript url 
Javascript :: filter data from object 
Javascript :: impress.js cdn 
Javascript :: angular async 
Javascript :: javascript Check Map Elements 
Javascript :: use effect hook 
Javascript :: bitcoin prices in javascript 
Javascript :: iterate over array of object javascript and access the properties 
Javascript :: javascript nullish 
Javascript :: javascript split a string 
Javascript :: how to upload picture on canvas in react 
Javascript :: JavaScript querySelector - By Tag name 
Javascript :: js alert with multiple buttons 
Javascript :: como checar valor do input checkbox angular 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =