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
Also in JavaScript:
- js stop form submit on enter
- user agent chrome
- check if type is blob javascript
- creating a table in js
- removing first item array js
- col to right bootstrap
- Build JavaScript Objects
- hide element js
- js pow
- react map
- email id validation in javascript
- make query param optional node
- how to reload the same page using javascript
- args slice discord.js
- add class jquery
- what is package.json
- how to get code suggestions for react components
- javascript change select options dynamically
- json object check if key exists java
- interceptor error handling angular 9
- javascript forever loop
- reference error $ is not defined jquery
- how to get session javascript ws3schools
- ondedrive