def character_count(html):
 count = 0
 strip_space = re.compile(u'\\s+')
 for match in re.finditer(u'>[^<]+<', html):
  count += (len(strip_space.sub(u' ', match.group())) - 2)
 return count

def character_count ( html ) : count = 0 strip_space = re . compile ( u'\\s+' ) for match in re . finditer ( u'>[^<]+<' , html ) : count += ( len ( strip_space . sub ( u' ' , match . group ( ) ) ) - 2 ) return count
return the number of "significant" text characters in a html string .