Scanf function for with C++ style and regex parsing.