for checking if regex proper there's bool ValidateRegEx(const char *regex);  which actually hand over this task to library.