Login: "string&number one&two" & "word&number two&three".
The desired conclusion "string number one two" & "word number two three".
In other words, the regular expression should match &only in the quoted phrases and remain between them. I was able to do only the following:
(?<=^|\s").*?([&])[^"]+
But there is an unwanted expression that matches only the first &in each phrase, if I use a greedy regular expression, it will only match the last &in the entire line.
How can I do it? I really tried many ways and lost my patience.
source
share