I found the appropriate version of this question in C #, but I was not able to convert it to search for VB.net syntax, and regular expressions are not my strong suit, so I will post what I received, and then threw myself at the mercy of the stack.
I managed to collect the regex:
Catch+\s+\b(_\w+|[\w-[0-9_]]\w*)\b+\s+As+\s+Exception+[\S|\r?\n]
which matches Catchesunspecified exceptions (plus a line, because this is part of what I'm working on). I want to expand this to look for empty Try / Catches, but apparently I missed something.
I am adding *+(Catch|End|Finally)to the previous regex to give:
Catch+\s+\b(_\w+|[\w-[0-9_]]\w*)\b+\s+As+\s+Exception+[\S|\r?\n]*+(Catch|End|Finally)
which, as far as I can tell, should match any mounting of spaces / lines and then the actual end-of-catch keyword, but I stop getting results at that point.
What am I bringing here?
source
share