How to extract from string to string ignoring newlines using regular expressions

What regular expression extracts from “title-1” to “end-1”?
I want to extract even if there is a line break in the middle.

title-1: (.+?)end-1

I tried to use Text parser but it did not work.
I think it’s because there is a newline.
Is there any other way than using Text parser?

@yoshi
Welcome to the make community

can you share the string?

2 Likes

Hi @yoshi ,

Maybe you could find something here.

BR,

PBI

2 Likes

Welcome to the Make community!

Screenshot_2024-02-20_151445

You can use a Text Parser “Match Pattern” module with this Pattern (regular expression):

title-1:\s+(?<match>[\w\W]+?)end-1

Important Info

  • :warning: Global match must be set to NO!

For more information, see Text Parser in the Make Help Center:

Match Pattern
The Match pattern module enables you to find and extract string elements matching a search pattern from a given text. The search pattern is a regular expression (aka regex or regexp), which is a sequence of characters in which each character is either a metacharacter, having a special meaning, or a regular character that has a literal meaning.

Hope this helps!

4 Likes