Any regex help would be appreaicted

Hey guys

I was wondering does anyone have experience doing regex to seperate different paragraphs, such as: "
Section 1
Content…

Section 2
Content"

I want to have section 1 and section 2 saved into different data fields, but having trouble to use the regex to do so, does anyone have any idea?

There is probably a regex to do it in one pass, but you can easily do it with 3 steps:

  1. find and replace by regex
    image

  2. split by your substitution
    image

  3. filter out empty elements with each item is not empty

now you have a list of text with your contents

Thank you for the reply! I tested it out, when I did the third step it returns ‘yes’ and if I remove this step then all content shows up, I am trying to save the ‘first item’ of the result but seem like it is saving all content.


well, the regex was specific to the text that you posted:

without a clear delimiter between sections it gets messy. If the section title is bold using bb code you can try this regex on the first step \[b\].+\[\/b\] but it will get any other bold text in the paragraphs.

wrong step, my bad. Use filtered with the condition this text is not empty

This topic was automatically closed after 70 days. New replies are no longer allowed.