Regular Expressions 101

Community Patterns

Javascript Comments

0

Regular Expression
ECMAScript (JavaScript)

/
(\/\*[\s\S]*?(.*?)\*\/)|(\/\/.*)
/
gm

Description

This covers both // styled comments as well as comments between /* and */. Supports multiline as well. Enjoy

Submitted by William Ramsey - 7 years ago