^ a-zA-Z0-9 excluding spaces?

I'm trying to find everything in a paragraph that is not abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789, not a space // gi

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

above does not work!

+8
source share
4 answers

You can also try:

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

If you want to exclude only spaces, use:

[^ ]*

Check the regex here if you want.

+5
source

^[\d\w]*$ ^ [\ w] * $ reg ' ^(start) $(end) 0-9a-zA-Z

++ ansistring="^[\\d\\w]*$";

+1

  , abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789, //gi

replaceAll("[^A-Za-z0-9\\s]", "")
0

All Articles