Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Selecting multiple paragraphs using GREP

New Here ,
Jul 02, 2018 Jul 02, 2018

Hi.

I have many passages of text in a manuscript tagged for lists: #BL# at the beginning of the first line and #EBL# at the end of the last line, with varying multiple lines between. I want to select all the text between the tags and apply a style.

#BL#This is the start of the list and can be followed by 2 or more paragraphs of text.

. . .

This is the last line of the list and can have multiple sentences before the last sentence ends here.#EBL#

I tried #BL#[^#EBL]+

which sometimes completely ignores a list and other times selects only part of the list.

Any help? Thanks!

1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Mentor , Jul 02, 2018 Jul 02, 2018

Hm, [^#EBL] won’t work as you may expect...

I would do it in 3 simple steps. Find/Replace #BL# and #EBL# to some single chars (unique in your text). Like this:

1. #BL# change to <

2. #EBL# change to >

3. Then this regex should do the trick:

<\K.+[^>]+

(will work in CS6 and CC versions)

Translate
Mentor ,
Jul 02, 2018 Jul 02, 2018

Hm, [^#EBL] won’t work as you may expect...

I would do it in 3 simple steps. Find/Replace #BL# and #EBL# to some single chars (unique in your text). Like this:

1. #BL# change to <

2. #EBL# change to >

3. Then this regex should do the trick:

<\K.+[^>]+

(will work in CS6 and CC versions)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jul 02, 2018 Jul 02, 2018

Hmm! …

… If you wanna apply the "Touched" para style [just as sample], a single shot will be enough, even if you're not a good shooter!

Find:  (?s)\#BL\#(.+?)\#EBL\#

Replace by:  $1

Replace by format: Touched (para style)

Best,

Michel, for FRIdNGE

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 02, 2018 Jul 02, 2018

No need to escape the #

(?s)#BL#(.+?)#EBL#

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jul 02, 2018 Jul 02, 2018

Aha! Totally right! Thanks JC! 

Best,

Michel

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 03, 2018 Jul 03, 2018
LATEST

Thanks!! This will save my bacon going forward.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines