Regex To Match Everything Except Letters And Spaces

A regular expression to match characters that are not letters and spaces in a string. Can be used to remove all characters except letters and spaces from a string.

/[^a-zA-Z ]+/g

Matches:

  • ABC123
  • 123ABC
  • ABC.123

Non-Matches:

  • ABC
  • AB CD
  • ABCD EFG

See Also: