When I use a regular expression like
std::regex midiNoteNameRegex("([cdefgab])([b#]{0,1})([0-9]))|([0-9]{3})|([A-Z0-9]{2})");
there are three top-level subexpressions connected by "|" in the pattern of which one will match. Is there a way to tell which one? Other than testing them sequentially one after the other?
If I would use named subexpressions it would be easy, but there are no named subexpressions in C++.
How do I solve this problem?