Regular Expressions 101

Community Library

Community Library Entry

-1

Regular ExpressionOpen Workspace

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

Description
Created·2015-08-26 21:21
Type·Match
Flavor·Python

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
Open Workspace