RegEx:
catch\s\(.*Exception.*\)*\s*(\n?)*\{\s*(//.*)*\s*\n?\}
It will match following formats
catch (Exception)
{
}
catch (Exception){}
catch (Exception)
{
//any c# comments
}
catch (Exception){
}
catch (Exception){
//any c# comments
}
catch (Exception ex)
{
}
catch (Exception ex){
//any c# comments
}
For details on searching in visual studio 2012 using regex:
http://msdn.microsoft.com/en-us/library/vstudio/2k3te2cs.aspx
Works like a charm! Thanks!
ReplyDelete