Copy link to clipboard
Copied
Hi guys,
I wonder if you can give me a little push in the right direction with this GREP code.
I want to find words which come before/after a space and a greater than symbol.
(?<=\s>)?\w+(?=\s>)
This is what I have but it doesn't find words which come after the symbol.
Menu > Menu > Menu
Would only find the first 2 Menus.
Thanks everyone
Hi Jakec,
Basically a GREP like
\w([^\r>]+\w)*
would do a very good job (including when the menu item contains inner space), since it captures every string that starts and ends with a word character while not containing any >.
Now, what you want is to make sure that the pattern above is either preceded by >\s, or followed by \s>, in order to exclude lines that do not contain the X > Y > … > Z structure at all. So in fact you have an alternation of two distinct regex, first based on a lookbehind, sec
...Copy link to clipboard
Copied
Thank you obi-wan kenobi. You were my only hope.
Sent from my iPhone
Copy link to clipboard
Copied
Hi,
Made an adjustment to our headers and now my GREP isn't working. Tried to adjust to no avail. Help again is greatly appreciated. This is the grep for the BEFORE scenario: (Article|Section)\h\d+(\.[A-Z])?\h\K[^/\r]+(?=\h\h//|$). How do I adjust this to work for the removal of the "2." from the format of our header, per the AFTER scenario shown below? Thank you so much!
BEFORE:
Article 2 District Standards // Section 2.A General District Standards
AFTER:
Article 2 District Standards // Section A General District Standards
Copy link to clipboard
Copied
Try this:
(Article|Section)\h(\d+\.)?[A-Z])?\h\K[^/\r]+(?=\h\h//|$)
In other words, make the number before the letter optional.
P.
Copy link to clipboard
Copied
Hmmm.. That unbolded everything.
Copy link to clipboard
Copied
I'm trying to find a GREP that will work for this scenario, where there will always be "Article" followed by a number, then "Section followed by a letter. Help is greatly appreciated!
Article 2 District Standards // Section A General District Standards
Copy link to clipboard
Copied
Peter Kahrel's code could be corrected to make it work as:
(Article|Section)\h(\d+)?[A-Z]?\h\K[^/\r]+(?=\h\h//|$)
or
(Article|Section)\h(\d+|[A-Z])\h\K[^/\r]+(?=\h\h//|$)
… more locked:
(Article\h\d+|Section\h[A-Z])\h\K[^/\r]+(?=\h\h//|$)
Best,
Michel, from FRIdNGE
Copy link to clipboard
Copied
Perfect, thanks!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now