This seems to be a simple grep search, but I can’t figure it out and it’s driving me crazy!
I’m trying to apply a style to a particular word, but only when it is part of a quote. Let’s say the word is “blah”.
“blah” may be, but is not necessarily the first or last word in a given quote, so I’m attempting to look for the following pattern: Quote mark>zero or more characters>blah>zero or more characters>quote mark
I would expect that the following would give me the result I’m after: (?<=(“.*))blah(?=(.*”)) , but this does not work.
The second half of the grep – blah(?=(.*”)) – seems to work as expected, and identifies my word when followed by zero or more characters and then a quote mark.
However, the first half of the grep – (?<=(“.*))blah – which should look for the quote mark and zero or more characters BEFORE the word, fails.
I’ve tried multiple variations on the syntax, with no success. I have found that it appears to be the * – “repeat zero or more times”, that appears to break the positive lookbehind.
Any input would be much appreciated!
Best
Chris