I have lots of code blocks like:
try
{
...
}
catch(Exception123 &e)
{
...
}
I want to replace them with something like this:
MY_MACRO(try
{
...
})
catch(Exception123 &e)
{
...
}
Exception123
is key, only blocks catching that specific type should be identified. But the exception caught might not always be called e
or exist at all. And the precise structure and formatting of the code-block isn't always the same... we might have try {
.
Is it feasible to use regex in a Visual-Studio find-replace for this? I couldn't figure out how I would group/identify the main try block.