I have a pattern that I need to replace in my .hpp, .h, .cpp files in multiple directories.
I have read Find and replace a particular term in multiple files question for guidance. I am also using this tutorial but I am not able achieve what I intend to do. So here is my pattern.
throw some::lengthy::exception();
I want to replace it with this
throw CreateException(some::lengthy::exception());
How can I achieve this?
UPDATE:
Moreover, what if the some::lengthy::exception() part is variant such that it changes for every search result ?
Something like
throw some::changing::text::exception();
will be converted to
throw CreateException(some::changing::text::exception());