I am having hundreds of lines as illustrated below, with more than one opening double-quote (“) occurring within almost every line as shown below:
... “ ... “ ..... “ .....
note: those dots (...) above denote both words & spaces in this context for illustrative purposes.
How to search (via regex) for every such occurrence within every line? I tried achieving this with:
“.*“or,“.* “but it is disappointingly returning even those who are proper i.e., with both opening & closing double quotes also (which is the correct way it should be) as follows:
... “ ...” ..... “ .....” ...... “ .....For every second
[space]“recurring within every line it encounters — How to replace them (via regex) into” [space]?
use
[^”]*instead of.*, so it will search all occurence of two opening quotes with any character sequence in between except of closing qoute.EDIT:
“[^”]*?“-- miss, that it will find largest srting between two opening quotes (OQ) as possible, in“some text “more text “textit will find“some text “more text “, so you need?after*.And as of your pictures, you are using sublime, so replace
(“[^”]*?)\s“with\1”()capturing a group, which you can access later with\n, wherenis group number.*?lazy expression, stop at first occurence of next character (\shere)\sany whitespace character (space, tab, new line, etc.)\1first captured group, here - opening quote and some textIt is possible to use look behind
(?<=text), but it length must be known, in your exampole its length is unknown (because of*).