Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to check for special charaters with spaces javascript

var format = /[ `!@#$%^&*()_+-=[]{};':"|,.<>/?~]/;
//            ^                                       ^   
document.write(format.test("My@string-with(some%text)") + "<br/>");
document.write(format.test("Mystringwithspaces") + "<br/>");
document.write(format.test("MyStringContainingNoSpecialChars"));
 Run code snippetHide results
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript if 
Javascript :: dm discord.js 
Javascript :: split 
Javascript :: history.back() and refresh in js 
Javascript :: how to write a function in javascript 
Javascript :: converting circular structure to json 
Javascript :: apollo graphql 
Javascript :: javascript wait to execute function on keyup 
Javascript :: post object 
Javascript :: switch statement in javascript 
Javascript :: what is undefined in javascript 
Javascript :: get window url from a browser extension 
Javascript :: javascript loop backwards 
Javascript :: remove parent element javascript 
Javascript :: select ng-options set default value 
Javascript :: react add splite image 
Javascript :: js try..catch works synchronously. 
Javascript :: react event listener 
Javascript :: gatsby change page url 
Javascript :: react hooks 
Javascript :: what is prototype javascript 
Javascript :: react get css root variables 
Javascript :: add update react pwa feature 
Javascript :: angularjs date 
Javascript :: hide and open jquery 
Javascript :: unexpected token w in json at position 0 
Javascript :: jade cdn 
Javascript :: summernote mentions ajax 
Javascript :: try catch 
Javascript :: how to use mdbreact in react js 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =