Copy link to clipboard
Copied
I'm trying to make a plain text so, that I can batch process all the layout formatting in one go.
I'm using this now for the GREP search/replace:
(!CSNUM2!)(\w\s*.*)(!CSNUM2!)
Is there a way that I can add to this formula it would include a (hard) line break? For example, all text between !CSNUM2! needs to become Arial Narrow, 11pt:
!CSNUM2!This is a line.
This is a second line.
This is a third line.
And so on!CSNUM2!
I've tried this on a document, but it applies the search/replace only to single lines.
I've also tried to add the multiline on (?m), but that doesn't work. Adding a forced line break \n to the code doesn't work, neither does the standard carriage return ~b.
Having to put the !CSNUM2! before and after every single line is going to take so much time that I can just go through the whole text by hand.
Any pointers?
Copy link to clipboard
Copied
Use single line modifier at the begining...
(?s)
Copy link to clipboard
Copied
You might also want to try this one:
(!CSNUM2!)(\X+)(\1)
Copy link to clipboard
Copied
Neither of these seem to work.
I don't know if it makes a difference to the response, but in the replace box I have $2 and a paragraph style set to change into.
Copy link to clipboard
Copied
The 2nd term between parenthesis of your Grep code has to be:
\X+?
(^/) The Jedi
Copy link to clipboard
Copied
Lifesaver! Thank you so much!
Copy link to clipboard
Copied
As so often, you can use different expressions for this. Apart from what Jean-Claude suggested (and Michel's correction) you can use a negative character class:
(?s)!CSNUM2!.+?!CSNUM2!
!CSNUM2!\X+?!CSNUM2!
!CSNUM2![^?]+?!CSNUM2!
P.