^a-zA-Z0-9 excluding spaces?

Ben Muircroft picture Ben Muircroft · Mar 8, 2012 · Viewed 36.6k times · Source

I am trying to find everything in a paragraph that is not abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 and not space / /gi

/[^a-zA-Z0-9]|[^ ]/gi

the above doesn't work!

Answer

DarkAjax picture DarkAjax · Mar 8, 2012

You could also try with:

/[^a-zA-Z0-9\s]/gi