Regular Expressions 101

Removal of Non Word Characters

Open Workspace
  • JavaScript
  • Substitution
0

Regular Expression

/
[^a-zA-Z0-9]\B
/
g

Description

An example of a regex to use when wanting to remove special characters from a string

Submitted by Anonymous