Skip to main content
Participant
June 30, 2021
Answered

Find/Change from a specific phrase until two paragraph breaks

  • June 30, 2021
  • 2 replies
  • 479 views

I hope to automate certain styles in a Songbook I'm putting together. The choruses are meant to stand out with their own style.

 

I've been messing around with GREP, trying to use Find/Change to select something like this:

 

[Chorus]
F#m
Oh oh stand by me
D E A
Oh oh stand stand by me stand by me

 

I want to search first by [Chorus], select all the lines in between, then end at two paragraph breaks as the verse starts.

 

I've had success with a couple commands so far. They will select about 8 or so, but not all, of which there are hundreds.

 

1. \[Chorus\]\r[\s\S]*?\r\r

 

2. \[Chorus\]\r(?!CS.*?)[\s\S]*?\r\r

 

I really just cobbled these together from reading online, so they really might look unusual and very questionable.

 

Any ideas why these might not select every one? I've checked and the other potential matches do have extra lines before the chorus.

This topic has been closed for replies.
Correct answer jctremblay

You have spaces before the single return.
Either fix this before using the code I gave you or you can try with this new one:

(?s)\[Chorus\].+?(?=\r(\h?\r)+)

 

2 replies

jctremblay
Community Expert
Community Expert
June 30, 2021

Hello, use to to apply your special style for the Chorus...

(?s)\[Chorus\].+?(?=\r\r)

 

Mykl5FAEAuthor
Participant
June 30, 2021

Merci bien de m'aider!

Unfortunately that didn't work. It does select the 7-8 choruses I mentioned that got selected with the code I mentioned in the original post:

 

 

But this chorus was not selected:

 

 

I wonder if I'm missing something very obvious.

jctremblay
Community Expert
jctremblayCommunity ExpertCorrect answer
Community Expert
June 30, 2021

You have spaces before the single return.
Either fix this before using the code I gave you or you can try with this new one:

(?s)\[Chorus\].+?(?=\r(\h?\r)+)

 

Willi Adelberger
Community Expert
Community Expert
June 30, 2021

Work with ifferent paragraph styles and select only those you want to edit.

Mykl5FAEAuthor
Participant
June 30, 2021

That is my goal. I will use Find/Replace to replace the found text with the correct character style.