position of matches

les abidnego25 at yahoo.com
Sun Jun 23 00:52:11 CEST 2002


Hi,
i am new to python and want to do the following:
given a string str='abcABCDefsgRSTVderDae'
i would like to find all the internal lowercase strings between 2 caps
i.e. pattern=re.compile(r'[A-Z]([a-z]+)[A-Z]')

match_obj=pattern.search(str)
begin,end=match_obj.span()

however i would like to get all the begining and end positions
of the pattern, 
i.e.
efsg  begin=7 end=10
der   begin=15 end 17
thanks



More information about the Python-list mailing list