Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
^RUN (.*?(?<! \\)$)
/
gms

Description

This will match the first RUN statement in a Dockerfile and capture all lines in that RUN statement (including those where the line continuation operator '' is used on the previous line.)

Submitted by Russ Frizzell-Carlton - 6 months ago