I want to pull every two characters following % characters out of a string.
I tried this:
>>> print a
asdfasf%12sas%44
>>> t=regex.compile('\(.*%\(..\).*\)*')
>>> t.match(a)
16
>>>
>>> t.group(1,2)
('', '44')
I just cant get it to yank out all instances as the group command shows.
Does Python allow for the above sort of regular expressions?
Also, if that won't work, what is the nicest way to accomplish this?
Thanks for any help.
David Williams, IUCF UNIX support Compute free or die!
dwwillia@indiana.edu Algorithm patents bite.
http://cs.indiana.edu/hyplan/dwwillia.html Join the revolution, use Linux.