I am exploring the idea of using multiple regex patterns to achieve my goal easily. Essentially, I am looking to replace all spaces in a string except for the ones that are enclosed within parentheses.
Let's consider an example:
Here is a string (that I want to) replace spaces in.
After applying the regex pattern, I expect the updated string to look like this:
Hereisastring(that I want to)replacespacesin.
Would it be possible to accomplish this using lookahead or lookbehind operators? I'm not entirely certain about how they function and whether they would suit this particular scenario.