0

I want every character possible (letters,numbers,everyting) except: !"#$'*+,/:;\|`

Is this correct? [^!"#$'*+,/:;\`|]

I made it work using http://www.regextester.com/ and your suggestions

*WORKS--> [^!"#$'*+,/:;\\`|]
Liev04
  • 401
  • 1
  • 5
  • 13

1 Answers1

0

A regex pattern to match a single \:

\\

It means you need to escape a backslash by adding another backslash to it. So, you need to use

[^!"#$'*+,/:;\\`|]
             ^^

Note that if you use it in a regular string literal in some programming language, you will have to double each of the backslashes (so that there are 4 backslashes).

Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563