"mk" wrote in message news:he60ha$iv...@ger.gmane.org...
Hello,
>>> r=re.compile(r'(?:[a-zA-Z]:)([\\/]\w+)+')
>>> r.search(r'c:/tmp/spam/eggs').groups()
('/eggs',)
Obviously, I would like to capture all groups:
('/tmp', '/spam', '/eggs')
But it seems that re captures only the last group. Is
On 2009-11-20, mk wrote:
> Hello,
>
> >>> r=re.compile(r'(?:[a-zA-Z]:)([\\/]\w+)+')
>
> >>> r.search(r'c:/tmp/spam/eggs').groups()
> ('/eggs',)
>
> Obviously, I would like to capture all groups:
> ('/tmp', '/spam', '/eggs')
You'll have to do something else, for example:
>>> s = re.compile(r'(?:[
Hello,
>>> r=re.compile(r'(?:[a-zA-Z]:)([\\/]\w+)+')
>>> r.search(r'c:/tmp/spam/eggs').groups()
('/eggs',)
Obviously, I would like to capture all groups:
('/tmp', '/spam', '/eggs')
But it seems that re captures only the last group. Is there any way to
capture all groups with repeat following