Regular Expressions 101

Community Patterns

Strip Commet

1

Regular Expression
ECMAScript (JavaScript)

/
\/\*.*?\*\/|(\/\/.*)
/
gi

Description

Strip comments with /* ... */ or // ...

Submitted by Willy - 8 years ago