I am performing a grep find and replace in my text editor TextWrangler on a very large CSV data file.
I have a source string of
hello??world ??goodnight?? moon?? wake up
and would like to replace the ?? substring with -- ONLY when it is bounded by non-whitespace characters on both sides, yielding a target string of
hello--world ??goodnight?? moon?? wake up
I have tried the following regex:
([\S]{1})?[\?]{2}([\S]{1})?
with the replace operation
\1\-\-\2
but the ?? within ??goodnight?? and moon?? are still being matched even though they are both bordered by whitespace on one side.