Regular Expressions 101

Community Patterns

C style comments

0

Regular Expression
PCRE2 (PHP >=7.3)

/
(\/\*.*?\*\/?)|(([ ]+)?\/\/.*?$)
/
gms

Description

Regular expression to match all C style comments.

Submitted by Seymoar Regex - 2 years ago