Integrated ctre which is mentioned in the links provided by @blauzahn and tested, performance is much better.
With ctre, we can't use xml for storing the regex, it should be added to the code. I've done the changes such that if there is any regex in the xml file, it would be used by old method, and if not matched, ctre match is used. This way, regex can be tested using the xml, once finalized, add it to the code. Please note, this change requires c++20.
Attaching patch