Community Patterns

Community Library Entry

-1

Regular Expression
Created·2015-08-26 21:21
Flavor·Python

r"
^(?:(((([^"\n]|(['\\]"))*?)((?<=[^\'])")){2})*[^"\n]*)(\/\/.*?)$
"
mg
Open regex in editor

Description

This regex matches java line end comments started with "//" and ignores such ones that are within String literals. (NO SUFFICIENT TESTING WAS DONE TO GUARANTEE 100% SAFETY)

Submitted by Janis Schöck