Regular Expressions 101

Community Library

Community Library Entry

0

Regular ExpressionOpen Workspace

/
^LIN[\s\S]*?(?=^LIN.*?)|^LIN[\s\S]*
/
gm

Description
Created·2020-03-02 10:13
Type·Match
Flavor·PCRE (Legacy)

^LIN[\s\S]?(?=^LIN.?)|^LIN[\s\S]*

FIRST PART From the first line string of an item line --> ^LIN over line breaks --> [\s\S]? to before (lookahead) the next line element --> (?=^LIN.?)

OR

SECOND PART From the first line string of an item line --> ^LIN over line breaks to the end of the string --> [\s\S]*

The first part matches all line elements, except the last line element. The last Line Element ist matched by the second part.

Submitted by Raik Zobel
Open Workspace