Support macro to turn on/off throwing exception reference: http://www.cplusplus.com/doc/tutorial/exceptions/ http://en.cppreference.com/w/cpp/regex/regex_error Need to find the source code in pcre2 to get constants of err.codes