Regular Expressions 101

Community Patterns

match comments

0

Regular Expression
PCRE (PHP <7.3)

/
(\/\/.*+|\/[*]{1,2}([^*]*[^*\/]|\R++|[*]+[^*\/])*[*]\/)
/
gm

Description

/** comments */

// to the end

/* comments */

Submitted by monk - 2 years ago