Regular Expressions 101

Community Patterns

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 - a month ago