C#: Find all empty catch blocks

前端 未结 9 1339
逝去的感伤
逝去的感伤 2020-12-23 22:08

I am reviewing some code.

I have notice some empty catch blocks. Not a good idea since somethings do not work and you cannot see why.

Is there an easy way to

9条回答
  •  攒了一身酷
    2020-12-23 23:05

    Press Ctrl + Shift + F. Expand Find options. Check Use Regular Expressions Paste this regex.

    catch\s*(\(\s*Exception(\s*\w+)?\))?\s*\{\s*\}
    

提交回复
热议问题