Hope someone can advise? I need to apply a character style to reduce the size of punctuation characters within a paragraph - all fine, but I need to exclude the % symbol from this. Can anyone advise?
Actually, it's a neagtive lookbehind (the negative lookahead would be (?!) and it won't do what you want since most puntuation, including the % wouldn't be followed by another %). I think what's happening is that it finds the %, then looks behind (somehow that I don't understand) and sees the % and doesn't modify it. I was surprised that this syntax worked as I thought the lookbehinds needed to come before the search terms.
My apologies - I wrote the wrong explanation for the expression - it is a negative lookbehind.
I never thought there were restrictions to the placements of the lookbehinds or lookaheads, positive or negative.
Peter Spier wrote:
Perhaps no restrictions, but you definitely get what I would call some unexpected behaviors if you put lookbehinds after the search string or lookaheads before.
You still get what you ask for. It's not very useful to preceed a constant text with a lookahead (since it would "always fail" or "always match"), but sometimes a construction like this can be handy: