Copy link to clipboard
Copied
Hello all.
I can find grep commands that do some of these things, but I need one that does all of them. For some wild reason, after spending hours online, I cannot find the solution. I appreciate your help. No, nested styles do not help here. I need a command in my paragraph style that does this:
- applies a character style up to AND INCLUDING a colon, ONLY if there's a colon in the paragraph.
- Ideally this goes up to just the first colon. If that's not possible, I need to set a word limit (let's say 10 words for example) on how far the search goes into the paragraph.
Thank you.
Words Limit = 10! So:
^(\H+\h){0,9}?\H+:
Words Limit = 4! So:
^(\H+\h){0,3}?\H+:
(^/)
Copy link to clipboard
Copied
Hi @Beemo8bit, add a Grep style with this pattern:
^[^:]+:
It means:
^ match start of text
[^:]+ match one or more characters that aren't colon
: match one colon
Copy link to clipboard
Copied
^.+?:
(^/) The Jedi
Copy link to clipboard
Copied
Thanks, but this doesn't have the word limit option that I really need too.
Copy link to clipboard
Copied
Words Limit = 10! So:
^(\H+\h){0,9}?\H+:
Words Limit = 4! So:
^(\H+\h){0,3}?\H+:
(^/)
Copy link to clipboard
Copied
You have saved my sanity!!!!!
Copy link to clipboard
Copied
Couldn't nested styles do this too?
Copy link to clipboard
Copied
Couldn't nested styles do this too?
By @Dave Creamer of IDEAS
I think the requirement for no match if there's no colon rules out a nested style as it would end up matching the entire paragraph.
Copy link to clipboard
Copied
Correct, I tried this already. If Adobe could add a nested style option for 'after' as well as 'before' or 'through', that would be a game changer! A feature I see that requested many years ago already....
Copy link to clipboard
Copied
Ah, missed that part...
Find more inspiration, events, and resources on the new Adobe Community
Explore Now