Is there any reason you can't use ```c_str()``` directly in ```regex_search```?  It should have a version that takes a ```const char*``` parameter, IIRC