given a C++ std regex is there a way to figure out what that regex would search for? get the string out that you put in when constructing it?
I’ve seen https://en.cppreference.com/w/cpp/regex/basic_regex and that doesn’t list anything helpfull here. The only thing I can thing of is generating every possible string and seeing what matches but that seems like an insane solution to this. sizeof(regex) is a constant 32 no matter how long I make the search text so some abusive memory manipulation is out of the question. I’ve tried casting to strings and char *s thinking maybe most of the other details about it would be known at compile time and look to be handled in the type. This feels like something that should be doable. Large codebase that I do not own so doing something like wrapping the regex in a class that can be implicitly converted to a regex but that also separately stores the search as a string is out of the question.