Community Patterns

Community Library Entry

0

Regular Expression
Created·2015-05-21 19:30
Flavor·Python

r"
("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|(?:[^/\n"']|/[^/*\n"'])+|\n)|(/\* (?:[^*]|\*[^/])*\*/)|(?://(.*)$)$
"
gm
Open regex in editor

Description

This regex removes double-slash comments while avoiding anything between 'quotes' or "double quotes".

Submitted by jlacroix