If you need to select everything AFTER the last EN-Dash, your solution is correct, but a bit redundat. you can loose either the lookbehind or the class: "(?<=–).+?$" or "[^–]+?$"
You should "dabble" with GREP as much as you can, it's one of the most powerfull features of inDesign
lol i will when i have something to dabble with.
the solution needs to include the en dash so it can be styled.
it needs to select from and inlcuding: – (en dash) and all text to and including the fullstop.
that works from the 1st en dash in the paragraph, it needs to style from the LAST en dash.
thanks for helping so far
true.. just tested it..
(it will select the end of paragraph also)
yes im testing as youre giving them to me.
the latest "–[^–]+\r" doesnt seem to do anything.
i should really learn to test what i post .. sorry:
did you test the latest one also?
still does nothing or am i just erm... an idiot... lol
tested, it works for me. lemme guess, you were using it in the find text tab instead of find grep?
happened to me more times than i care to remember.
btw.. make sure you type it, don;t use copy paste.
im not actually using find/change.
its to be part of a paragraph style and im testing the grep by apply red to the characters from the grep style pane (edit para style)
are you sure those are En dashes, not just plain dashes? they look a bit short to me
yes i checked... it worked on one paragraph then i created a new frame with new text and it doesnt work now... i dont get it... ahhhhh
uh... aa.. can you please e-mail me your test document: vamitul[at]gmail[dot]com
thank you very much for your help Vamitul.
my colleague said "Thanks, that Grep is so cool. I just wish I understood it."
so i was wondering if it could be broken down for the newbies?
my colleague and myself lol.
ps he has the link to this post and knows that the credit is all yours
cheers and thanks... love ya work!
goodness me... how is mine different?
@Lilia – you did not type a paragraph sign yet, aren't you?
(I can't see that out of your screen shot)
Also what is required that this particular GREP in a paragraph style could kick in:
at least a single character AFTER the en-dash.
1 person found this helpful
The first grep in the file i'we sent you is:
it means: find a EnDah (–) followed by any character that is not a EnDash ([^–]) repeating as few times as possible (+?) until it finds a paragraph mark (\r).
The [^–] is called a character class. It matches any character between the square brackerts. so "[abcd]" matches any of the four charactes. When adding a "^" at the start of the expression turns it into a negative character class, so it matches any charater that it is NOT in the list. for example [^abcd] will match any character except the four letters.
The second grep in the file is:
It works just like the first one, with the difference that it tries to find everything until it matches a dot character (\.) instead of a end of paragraph.
This is probably the best grep tutorial i found online, and the one i used to learn: http://www.regular-expressions.info/tutorial.html
Then there is the forum's grep guru Peter Kahrel's excelent book http://www.amazon.com/GREP-InDesign-CS3-Peter-Kahrel/dp/B001O7HEPM/
(btw, Peter, is there a newer version of the book?)
Try them out. Like i said, grep (and scripting) are probably the most powerfull tools indesign has. With a few well written greps you can cut down the time needed to format a book by a quarter or more, sometimes.
apply paragraph style: Title 1
That means find a roman numeral at the beginning of the paragraph, followed by a dot and a tab. For my books, that means it's a first level heading, so with a click of a button I can formatt all the headings in my book.
Now a word of warning about grep styles: They are computationally intensive. Use them sparingly. On my home machine (i7, 8gb ram, windows), 6 grep styles on a 400 page document brings everything to a crawl.
thank you... you're awesome