(Hopefully) Simple GREP Query
Learn / Forums / General InDesign Topics / (Hopefully) Simple GREP Query
- This topic has 9 replies, 4 voices, and was last updated 5 years, 10 months ago by Michel Allio for FRIdNGE.
-
AuthorPosts
-
-
May 20, 2018 at 12:22 am #103857David LovesyMember
Hello all! New member here, really keen to explore the possibilities of GREP.
I have a 300 page book that I am working through, but I now need to find the first two words of every paragraph in a specific paragraph style in order to underline them. The style and the underline is not a mystery, but can anyone help me with the GREP term to find the first two words of a paragraph? They might follow a paragraph break, but never a period/space setup.
TIA!
-
May 20, 2018 at 1:14 am #103858Claudio MarconatoMember
Hi David,
if I understood well this is a simple GREP.Find two words at the beginning of a paragraph:
^\w+ \w+Replace with the same 2 words:
$0at the same time you can apply all the styles and formatting options that you want in the replay format section
-
May 20, 2018 at 5:28 am #103861Graham ParkMember
Why GREP how about a Nested Style??
-
May 20, 2018 at 6:03 am #103862Claudio MarconatoMember
Why not?
David wanted to explore the possibilities of GREP so I answered with a GREP, nests styles remain a possibility in this case.
Also the same GREP could also use to apply a GREP style instead of a search and replace. -
May 20, 2018 at 6:23 am #103863Graham ParkMember
True but a Nested Style would be the easiest and quickest approach. Sure you can do it with GREP but I would not thing that is the best way in this case. If it was across an number of different paragraph styles then I might use GREP.
Always a good idea to learn the best solution. There are better examples of when and how to use GREP. -
May 20, 2018 at 6:40 am #103864Michel Allio for FRIdNGEParticipant
-
May 20, 2018 at 6:45 am #103865Graham ParkMember
Create a Character Style UNDERLINE and then NESTED STYLE – Underline Upto 2 Words.
Done.
As it is only for one specific Paragraph Style this seems to be the easiest way. -
May 20, 2018 at 7:22 am #103866Michel Allio for FRIdNGEParticipant
Ok! … So, question for both of you!
Why this can’t be really relevant?
In the sample, I’ve used what Graham proposed!
Best,
Michel -
May 20, 2018 at 3:41 pm #103867Graham ParkMember
Why would someone be useing non breaking space in the first three words of a paragraph?
A pretty unlikely scenario. -
May 20, 2018 at 5:08 pm #103869Michel Allio for FRIdNGEParticipant
Surely someone who would not know … Jean de La Fontaine!
Best,
Michel
-
-
AuthorPosts
- You must be logged in to reply to this topic.