Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to check for special characters in javascript

var format = /[!@#$%^&*()_+-=[]{};':"|,.<>/?]+/;

if(format.test(string)){
  return true;
} else {
  return false;
}
Comment

javascript check if string contains special characters

var email = "grepper@gmail.com";
if(email.includes("@")){
  console.log("Email is valid");
}
else{
  console.log("Email is not valid");
}
// includes return boolean, if your string found => true else => false
Comment

PREVIOUS NEXT
Code Example
Javascript :: regex get number inside parentheses 
Javascript :: javascript leave page warning 
Javascript :: npx create-react-app 
Javascript :: install react 
Javascript :: input will get only number vue 
Javascript :: jquery check if div has a certain style 
Javascript :: angular 11 on hover 
Javascript :: react props.children proptype 
Javascript :: math random equitative js 
Javascript :: check if date time string is invalid date js 
Javascript :: latest react version npm 
Javascript :: go to page jquery 
Javascript :: how to get client.user.avatar 
Javascript :: javascript indexOf object value in array 
Javascript :: navigate to url jquery 
Javascript :: js number remove last 2 characters 
Javascript :: upgrading node on mac 
Javascript :: jquery click or touch 
Javascript :: python print pretty json 
Javascript :: how do i backspace from javascript calculator 
Javascript :: javascript remove negative numbers from array 
Javascript :: if str contains jquery 
Javascript :: javascript regex match any character including newline 
Javascript :: jquery add attribute 
Javascript :: select2 on change 
Javascript :: Could not resolve dependency error peer react@"^16.8.0 || ^17.0.0" from @material-ui/core@4.12.4 
Javascript :: how to get current screen name in react native 
Javascript :: jsx 
Javascript :: node sleep 
Javascript :: window.href 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =