Posts Tagged ‘regular expressions’
Finding Code Issues with Regular Expressions
Finding dead code removed with pre-compiler directives:
^:Wh*\#~(else|endif|if DEBUG|region|endregion):i*
Finding unused exception blocks:
Visual Studio (single line only):
catch:Wh*\(:Wh*:a*Exception:a*:Wh*:a*:Wh*\):Wh*\{:Wh*\}
grepWin:
catch\s*\(\s*\w*Exception\w*\s*\w*\s*\)\s*\{((\s*\/\/.*?)|(\s*?))*\}
Finding console outpout:
Console.*Write.*(.*);
Finding trace outpout:
Trace.*Write.*(.*);