Regular Expressions 101

Community Patterns

HTML comments

2

Regular Expression
PCRE (PHP <7.3)

/
<!--\s*([\s\S]*?)\s*-->
/
g

Description

Groups HTML comments that are between <!-- and -->.

Submitted by Greaka - 8 years ago