

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Write a Regular Expression to remove all special characters from a JavaScript String?
To remove all special characters from a JavaScript string, you can try to run the following code −
Example
<html> <head> <script> var str = "@!Welcome to our website$$"; document.write(str); // Removing Special Characters document.write("<br>"+str.replace(/[^\w\s]/gi, '')); </script> </head> <body> </body> </html>
- Related Questions & Answers
- How to write a Regular Expression in JavaScript to remove spaces?
- How to write Python Regular expression to remove non unicode characters?
- How to remove all special characters, punctuation and spaces from a string in Python?
- How to use special characters in Python Regular Expression?
- MySQL regular expression to update a table with column values including string, numbers and special characters
- Remove all characters of first string from second JavaScript
- How to print all the characters of a string using regular expression in Java?
- Replacing all special characters with their ASCII value in a string - JavaScript
- How to write Python regular expression to check alphanumeric characters?
- How to remove special characters from a database field in MySQL?
- Remove characters from a string contained in another string with JavaScript?
- How to remove all non-alphanumeric characters from a string in MySQL?
- JavaScript Remove non-duplicate characters from string
- JavaScript - Remove first n characters from string
- MySQL query to remove special characters from column values?
Advertisements