I have a GREP command:
(?<=say).+.".+?"
It finds all lines that have say (but doesn't include it), quoted words and characters between it.
It would like to make a change only to the quoted words (not the characters in between) but
(?<=say)(?<=.+.)".+?"
this doesn't work.
Here an example of the text I need to change:
I spoke to the Captain, saying: "Sir, I would like to home".
...to say, "This is the way".
Which should be changed into this by GREP command:
I spoke to the Captain, saying: "Sir, I would like to home".
...to say, "This is the way".
Could someone help me?
I don't think you can have a variable length lookbehind; that's not possible in most flavors of REGEX, and I'd bet that's the case for ID. You could possibly do two Greps, one to apply the style to everything after 'say' and another to remove it from the text between say and the quotation mark (this would of course assume no other rendering in between). Or you could use your initial regex to insert some characters that you could then search for and use as a basis to apply the italics. Or, you could script it.
This page talks about the limitations of lookbehind: http://www.regular-expressions.info/lookaround.html
An example using positive lookbehind and lookahead to find the content between 'say' and the quotation mark:
(?<=say).+?(?=")