I need to extract the following pattern from a string and return one of the possible matches according to the input.
I used regular expressions, through different pos