diff -r 58ee0c60d6bf Doc/library/re.rst --- a/Doc/library/re.rst Fri Nov 02 07:34:52 2012 +0100 +++ b/Doc/library/re.rst Fri Nov 02 10:04:23 2012 +0100 @@ -824,9 +824,17 @@ Match Objects ------------- -Match objects always have a boolean value of :const:`True`. This lets you -use a simple if-statement to test whether a match was found. Match objects -support the following methods and attributes: +Match objects always have a boolean value of :const:`True`. +Since :meth:`~regex.match` and :meth:`~regex.search` return ``None`` +(which has a boolean value of :const:`False`) when there is no match, you can test +whether there was a match with a simple ``if`` statement. For +example:: + + match_object = re.search(pattern, string) + if match_object: + process(match_object) + +Match objects support the following methods and attributes: .. method:: match.expand(template)