GREP to change style after "|"
- This topic has 3 replies, 4 voices, and was last updated 7 years ago by .
- You must be logged in to reply to this topic.
Learn / Forums / General InDesign Topics / GREP to change style after "|"
Learn / Forums / General InDesign Topics / GREP to change style after "|"
Tagged: GREP
Ive got a list (its actually a table with each line in its own row in case that matters) that looks like the following:
First Item | Then a description of varied length
Another Item | Also with a description
And One More Item | With one more description
I want the text that precedes the ” | ” to have one style and the text that follows the ” | ” to have a different style
is there a way to do this using GREP? ANd if so, what would the GREP look like.
^[^|]+\|
Beginning of a para
followed by a character, that is not “|”
one or more times
followed by a “|”
Kai
Really basically here, 2 Grep styles:
.+(?=\h\|)
\|\h\K.+
(^/)
Hi Steve,
Is it mandatory to use GREP in this scenario. This can simply be done using using the Nested Styles and you won’t have to run Find/Change every time.
I hope you have the Paragraph Styles already in place. Just tweak the associated para style, something like this:
Nested Styles:
CharacterStyleForTheTextBeforePipeSign
up to
1
|
Please let me know if it works.
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies allows us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
To provide the best experiences, we and our partners use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us and our partners to process personal data such as browsing behavior or unique IDs on this site and show (non-) personalized ads. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Click below to consent to the above or make granular choices. Your choices will be applied to this site only. You can change your settings at any time, including withdrawing your consent, by using the toggles on the Cookie Policy, or by clicking on the manage consent button at the bottom of the screen.
You have to be logged in to save.
Not a member? Join Today - it's FREE!