Q:

python regex: group of groups?

I have strings like this
s = 'MR1|L2-S1x' 

The pattern is always the same: one or two characters, optionally followed by a number and a divider in [|.+:x-]. This pattern can be repeated until 6 times.
So the matching pattern is clear.
p = r'([A-Z]+)(\d)?([|.+:x-]+)'

But how to make it match it the string as a group of groups? 
More precisely: now I get 
t=re.search(p,s)
t.groups()
('MR', '1', '|')

What I want, though, is
('MR', '1', '|'),('L', '2', '-'),('S', '1', 'x') 

A:

The user "undefined is not a function" (in comments) is correct.
Use findall to get all matching groups.
Python 2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> s = 'MR1|L2-S1x'
>>> p = r'([A-Z]+)(\d)?([|.+:x-]+)'
>>> import re
>>> t = re.findall(p, s)
>>> t
[('MR', '1', '|'), ('L', '2', '-'), ('S', '1', 'x')]
>>>

