Regular Expressions 101

Community Patterns

reverse commenting/code order

0

Regular Expression
PCRE2 (PHP >=7.3)

/
(^\w.*\n\n)+(^(##.*\n)+)
/
gm

Description

reverses order when code is followed by comments (comments prepended with ## )

Submitted by anonymous - 2 years ago