I think I can do this with a few regular expressions quite easily, but I want to replace all the spaces in the string, but not when these spaces are between the parentheses.
For instance:
Here is a string (that I want to) replace spaces in.
After regex, I want the string to be
Hereisastring(that I want to)replacespacesin.
Is there an easy way to do this with lookahead or lookbehing?
I am a bit confused about how they work, and not sure if they will work in this situation.
source
share