I'm editing a long document and have benefitted from community assistance already, but being new to GREP Style, Find/Change I need to ask for further help.
Below a screenshot of the scenario (original). The two blocks of text you see anticipated by the icons have have different paragraphs styles. Icons are placed as custom glyphs.
Now, the last line featuring C2, 9, 14,... is the target of this post. Those are London buses and I created a paragraph with another icon. The copy I'm working with unfortunately is as you see. Buses come after ";".
The aimed result is to place a \r after the semicolon and assign the new paragraph style. The element to work with is (probably) the last ";" before the bus listing. All entries feature it in the same way, hence a global GREP Find/Change should be working fine.
From a previous discussion I used (?<=\;)[^;]+$ to match everything from the end up to the last semicolon, but then I found problematic preserving the matched characters and placing \r (using (?<=\;). starts at the beginning and stops at every semicolon+space)
So question one: how to stop at the first semicolon from the end and replace the space with \r to create a new paragraph?
Then, there's question two :-)
From my previous attempts I noticed that when replacing semicolon + space with \r, and changing the paragraph style all at once (from Rail to Bus) caused the Rail paragraph style to change as well (makes sense) to Bus style. So I tried to tell the Rail paragraph style that 'Style for following paragraph is Bus style' (and not change the paragraph style in Find/Change), but somehow that didn't work either.
So second question is: considering to split the Find/Change in two steps, how can I then change into / apply to the newly created paragraph the correct Bus style?
I thank you in advance for your precious help. So far the community has been great!
Tested your regex combo and works pretty spot on! I am amazed by the power of regex / GREP and hope that by way of experimenting with it I'll get my head around.
Many thanks for your precious help!