Regular Expressions 101

Quiz_17_Start_before_end

Open Workspace
  • PCRE2 (PHP)
  • Substitution
2

Regular Expression

/
^(?:(?!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