Regular Expressions 101

Community Patterns

comment separator

1

Regular Expression
PCRE (PHP <7.3)

/
(.*)((?:\/\*|\/\/|--).*)
/
g

Description

works fine for // and -- but has issue with multi line comment(/**/)

Submitted by anonymous - 8 years ago