12cc104 at gmail.com
Fri Apr 27 08:33:57 CEST 2007
i have a regex: rx_test = re.compile('/x([^x])*x/')
which is part of this test program:
rx_test = re.compile('/x([^x])*x/')
s = '/xabcx/'
i expect the output to be ['abc'] however it gives me only the last
single character in the group: ['c']
can anyone point out why this is occurring? i can capture the entire
group by doing this:
rx_test = re.compile('/x([^x]+)*x/')
but why isn't the 'star' grabbing the whole group? and why isn't each
letter 'a', 'b', and 'c' present, either individually, or as a group
(group is expected)?
any clarification is appreciated!
More information about the Python-list