Hi Marcin,
Correct - it returns the most recently captured text for your sole group.
Also correct, because match.group() returns the whole of the matched text.
If you wanted just your captured piece, you need this:
'100.'
Hope that helps!
--
Richie Hindle
richie@entrian. com
subnetlist="192 .168.100.0 , 192.168.101.0"
ipre=re.compile ("([0-9]{1,3}\.){3}[0-9]{1,3}")
>
['100.', '101.']
ipre=re.compile ("([0-9]{1,3}\.){3}[0-9]{1,3}")
>
>ipre.findall(s ubnetlist)
a=ipre.finditer (subnetlist)
'192.168.100.0'
>a.next().group ()
If you wanted just your captured piece, you need this:
>a.next().group (1)
--
Richie Hindle
richie@entrian. com