Forked from trebron21/Regex to search only in NCLOCs
Created
February 16, 2023 03:10
-
-
Save yaowenqiang/5003900eaf4bf13eb144657137319f08 to your computer and use it in GitHub Desktop.
Regex to search only between uncommented lines (NCLOC - Non-Comment Lines Of Code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Search only between uncommented lines (NCLOC - Non-Comment Lines Of Code): | |
First solution matches "keyWord" which is not commented with single line comment // | |
^*(?<!\/\/.*)keyWord // this uses negative lookbehind | |
or another solution without lookbehind for regex engines, that does not support it: | |
^[^//]*keyWord |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment