0

i'm looking for a way to way to match / and \ for example: if i get the string "hello\sir/!" i'd like to get hello\sir/!

splash
  • 13,037
  • 1
  • 44
  • 67
MOses
  • 71
  • 9

1 Answers1

0

Maybe try using (.*\\.*\/.*):

.* Should match every single character or nothing
\\ Should match a backslash (Two of them since you need to escape)
\/ Should match a common slash (With a backslash since you need to escape)
(...) Should be the capture group

Watch out for multiline tags (Depending on the text you want to match with)...

https://regex101.com/r/HY0NXI/3

Mateus
  • 4,863
  • 4
  • 24
  • 32