#!/usr/bin/env python3"""For each argument on the command line, look for it in the set of all Unicodenames. Arguments are treated as case-insensitive regular expressions, e.g.:% find-uname 'small letter a$' 'horizontal line'*** small letter a$ matches ***LATIN SMALL LETTER A (97)COMBINING LATIN SMALL LETTER A (867)CYRILLIC SMALL LETTER A (1072)PARENTHESIZED LATIN SMALL LETTER A (9372)CIRCLED LATIN SMALL LETTER A (9424)FULLWIDTH LATIN SMALL LETTER A (65345)*** horizontal line matches ***HORIZONTAL LINE EXTENSION (9135)"""import unicodedataimport sysimport redef main(args):unicode_names = []for ix in range(sys.maxunicode+1):try:unicode_names.append((ix, unicodedata.name(chr(ix))))except ValueError: # no name for the characterpassfor arg in args:pat = re.compile(arg, re.I)matches = [(y,x) for (x,y) in unicode_namesif pat.search(y) is not None]if matches:print("***", arg, "matches", "***")for match in matches:print("%s (%d)" % match)if __name__ == "__main__":main(sys.argv[1:])
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。