regex - Using regular expressions to locate line comments without spaces -
i tried find comments beginning //
don't have space after slashes.
want select only slashes. no whitespace or text before that, no whitespace or text after that.
far i've reached [\s].(\/\/(?! ))
catches space before slashes well.
basically wanna make sure line comments have space after slashes. i'm trying either in javascript or in text editor.
since javascript doesn't have lookbehind feature, can't.
the workaround (for instance, in replacement context) use capture group character before 2 slashes , start replacement string reference group ('$1replacement'
):
([^/\s]|^)//(?! )
Comments
Post a Comment