Regular Expressions 101

Community Patterns

Reads C-like comments

0

Regular Expression
Python

r"
(?:(?s)\/\*((?:(?!\*\/).)*?)\*\/)
"

Description

Reads C comments as this "/* Do test / and removes / */ parts and leaves only comment part

Submitted by Shuhrat Rahimov - 8 years ago