Regular Expressions 101

Community Library Entry

2

Regular Expression
PCRE2 (PHP >=7.3)

/
^(?:(?!end).)*start.*
/
gm

Description

Only match lines with the text start, unless text end appears prior to start. Note: end may or may not be in the string.

Match start line_end; and don't match line_end; start

Submitted by anonymous - 2 months ago