Forum Replies Created
-
AuthorPosts
-
August 1, 2015 at 7:08 pm in reply to: GREP: Different behaviour of positive lookahead/lookbehind #77088
Chris Court
MemberOK, thanks again, David.
Just to simplify my original question, I’m looking for a way to “Find all examples of the word ‘blah’ where there is no quote mark in the paragraph.” Or more specifically, “Find all examples of the word ‘blah’ where there is no quote mark preceding it in the paragraph.”
If anyone else has any bright ideas as to how to achieve this, I’d love to hear from you!
Best
ChrisAugust 1, 2015 at 10:46 am in reply to: GREP: Different behaviour of positive lookahead/lookbehind #77084Chris Court
MemberOK, Interesting… and useful. It works!!
Unfortunately I don’t have access to the InDesign magazine… so here is my next question: Is there an inverse to \K? An equivalent to a NEGATIVE lookbehind? For example, if I want to locate all examples of “blah” that are NOT preceded by a quote mark and possibly additional text?
Thanks for your help, David.
Best
ChrisChris Court
MemberThanks so much, David!
The syntax on the page you linked to worked a charm… although I did have to change a couple of smart quotes to dumb quotes before the script recognised it.
Chris
June 2, 2015 at 12:28 pm in reply to: Different results from GREP find/change, and the FindChangeByList script #75770Chris Court
MemberThanks for your help, amigos,
As you guessed, Carles, yes, I still have the remove double return line in there…
Duh!
Thanks again!
ChrisChris Court
MemberHey Kenneth,
I’m no black-belt in GREP, but I may have an answer your question as to why your original style is failing on the specific case you mention.
Your GREP style looks for any characters that lie between a period and a question mark, and apply a character style to this text, up to and including the question mark. Now, you will notice that in the paragraph where your style fails, there is a second period, immediately before the word “Soul”. Your GREP sees this first period, and sees the question mark, and styles everything in between, including the first sentence and the second period.
The following GREP should identify only the text you need, correctly… (?<=\.)[\w]+\?
It seems as if David’s second GREP SHOULD work, but for some reason it doesn’t. Not sure why.
C
Chris Court
MemberGenius! That's exactly the solution I was looking for.
I'm still trying to get a grip on grep – getting there slowly.
Thank you!
C
-
AuthorPosts
