Copy link to clipboard
Copied
Having a problem trying to apply bold char style to instances of text between parenthesis and quotations e.g ("xyz")
Grep expression I've used is: (?<=\(“).*(?=”\))
It works partially but when there is more than one instance in a paragraph it is not working as intended and highlights more than intended. Screenshot below showing this situation. Can someone please tell me what expression should be used to correct this? Thanks.
Change your GREP query to this one:
(?<=\(“).+?(?=”\)) instead of *
In English, it should be “one or more times (shortest match)”
Copy link to clipboard
Copied
Change your GREP query to this one:
(?<=\(“).+?(?=”\)) instead of *
In English, it should be “one or more times (shortest match)”
Copy link to clipboard
Copied
Thanks!
Copy link to clipboard
Copied
GREP, by default, is "greedy".
"?" in @jmlevy reply makes it "non-greedy" / "lazy" - so GREP will be looking for the "shortest match".
Copy link to clipboard
Copied
Thanks Robert, good to know 🙂