To the best of my regex knowledge, you'll need to use two regular expressions to replace all the o's between the delimiters. The first one would be to actually grab the text within the delimiter. For example:
(?P<start>\$\$) # start by grabbing the starting literal '$$'
(?<middle>.*?)(?=\$\$) # then grab everything up until the ending '$$'
(?P<end>\$\$) # now grab the ending '$$'
Example: https://regex101.com/r/015Xj8/4
Obviously you know what the start and ending is so you can simplify it further if you wanted (no start or end group for example), but I've included that for thoroughness.
Once you've captured the start/end of it, you can replace the o
by a straight find/replace on the literal 'o'. As far as I know, it takes two steps via regex to do what you're after. I'm not too knowledgeable about sublime but perhaps there's a sed-like replacement feature in it.
The following will replace the first o
in the string (similar to the other answer by virolino), but you'll need to click "Enter" a bunch of times to make sure that all the last o's are replaced for this to be useful:
(?P<start>\$\$)
(?<middle>.*?(?<first_o>o).*?)(?=\$\$)
(?P<end>\$\$)
Or, if you're just looking to capture O's (and nothing else), you can just make sure it's between a starting and ending $$
:
\$\$.*?(o).*?\$\$