I intercept messages containing the following characters:
*_-
However, whenever any of these characters pass, it will always be preceded \. \is for formatting only, and I want to remove it before sending it to my server. I know how easy it is to create a regex that removes this backslash from a single letter:
'omg\_bbq\_everywhere'.replace(/\\_/g, '')
And I understand that I can just perform this operation 3 times: once for each character I want to delete the previous backslash. But how can I create one regex that detects all three characters and removes the previous backslash in all three cases?
source
share