Okay...
Cool.
Jacob


group() defaults to returning group 0 which is the whole match.

 >>> import re
 >>> string = 'My phone is 410-995-1155'
 >>> pattern = r'\d{3}-\d{3}-\d{4}'
 >>> re.search(pattern,string).group()
'410-995-1155'

Kent

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to