import reregex = r"([ABC]{1,3})(.{0,2})([DEFG])(.{2,3})(V)"test_str = "AXDXXV"print(re.match(regex, test_str).groups())
Standard input is empty
('A', 'X', 'D', 'XX', 'V')
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!