Regular Expressions 101

group & access several lines

Open Workspace
  • PCRE (Legacy)
  • Match
1

Regular Expression

/
Foo\n=+\n((.+)(?:\n-+\n))+
/
g

Description

Hi there,

I try to learn and improve my regex knowledge... I want to fetch all lines below the "="-line and between the "-"-lines and access them via $1 - $n. Is this possible? Or should I fetch the whole string below the "="-line and the last "-"-line, then seperate the lines after that in another regexp? How can I find the end then?

Thank you in advance for your help.

Submitted by Floffy