import re # as per the documentation these might change dependingon unicode or ASCII classes = "wWbBdDsS" for cls in classes: reg = "\\"+cls asc = re.compile(reg,re.A) uni = re.compile(reg) for c in range(128): char = chr(c) if not (bool(asc.match(char)) == bool(uni.match(char))): # ascii char but the unicode and ASCII regexes do not agree print(cls,":",repr(char))