Regular Expressions 101

Community Patterns

multiple in between regex

0

Regular Expression
PCRE (PHP <7.3)

/
(?<=START)(?s)(.*?)(?=Closing)
/
g

Description

this helps to extract the start and end tag but even if in between the start appears again.. it just captures the first start and the next occurence of end tag.

only thing missing is i want to include the end of the line of the end tag

Submitted by anonymous - 6 years ago