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

Selecting multiple paragraphs using GREP

New Here ,
Jul 02, 2018 Jul 02, 2018

Copy link to clipboard

Copied

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!

Views

1.0K

Translate

Translate

Report

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)

Votes

Translate

Translate
Mentor ,
Jul 02, 2018 Jul 02, 2018

Copy link to clipboard

Copied

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)

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

No need to escape the #

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Aha! Totally right! Thanks JC! 

Best,

Michel

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

Thanks!! This will save my bacon going forward.

Votes

Translate

Translate

Report

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