>If it's in Visual Studio 2012 or later, there's an RegEx you can use. Copy-and-paste this into your Ctrl+Shift+F (Find Solution) and it will search all source code:
>
^(?!(\s*\*))(?!(\s*\-\-\>))(?!(\s*\<\!\-\-))(?!(\s*\n))(?!(\s*\*\/))(?!(\s*\/\*))(?!(\s*\/\/\/))(?!(\s*\/\/))(?!(\s*\}))(?!(\s*\{))(?!(\s(using))).*$
>
>Here's one that counts all except blank lines and { and }:
>
(^(?!(\s*//.+)))+(^(?!(#.+)))+(^(?!(\s*\{.+)))+(^(?!(\s*\}.+)))+(^(?!(\s*\r?$)))+
>
>In Visual Studio 2010 or earlier, use this one:
>
^~(:Wh@//.+)~(:Wh@\{:Wh@)~(:Wh@\}:Wh@)~(:Wh@/#).+
>
>Also, modern Visual Studio versions have a built-in "Code Metrics" which will tell you things about your code:
>
https://docs.microsoft.com/en-us/visualstudio/code-quality/code-metrics-values?view=vs-2017Thanks
This works.
It is very interesting.
For the line of codes, this is in Analyze\Calculate Code Metrics. It provides additional useful information.