Regular Expressions 101

Community Patterns

Community Library Entry

2

Regular Expression
Created·2024-10-08 13:59
Flavor·PCRE2 (PHP)

/
^(?:(?!end).)*start.*
/
gm
Open regex in editor

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