(maint) Fix improper use of function try blocks.

In C++, function try-blocks implicitly rethrow the caught exception.
Therefore, the use of them in the regex adapter is incorrect.
Additionally, since the regex adapter isn't fully constructed, the _err
member cannot be used in a catch block and doing so will likely result
in a segfault.

The proper fix is to call the assign member and catch the exception it
throws.