'Find a source codename (diceware passphrase) in HTML'

def _find_codename(self, html):

    codename_re = '<p    [^>]*id="codename"[^>]*>(?P<codename>[a-z0-9    &#;?:=@_.*+()\\\'"$%!-]+)</p>'
    codename_match = re.search(codename_re, html)
    self.assertIsNotNone(codename_match)
    return codename_match.group('codename')
