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

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -