Calling all regex gurus. I am trying to the following regex pattern /(([^a-zA-z0-9-_.])|(^)|([)|(]))/gm
to remove special characters from file names but am a bit confused about why it is not catching
all special characters not included in the first match group. I added the second match group to catch some characters that it was not matching with, but am worried about others that it may not be catching.
Asked
Active
Viewed 18 times
0

B Kelly
- 5
- 2
-
[`[A-z]` matches more than just letters](http://stackoverflow.com/questions/29771901/why-is-this-regex-allowing-a-caret/29771926#29771926). – Wiktor Stribiżew Jan 28 '21 at 19:50
-
I didn't even notice I made the second z lower case. Thanks! – B Kelly Jan 28 '21 at 21:27