GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — python-readability/tmp.py at master · initc/python-readability Expand file tree/ Copy pathtmp.pyMore file actions 23 lines (18 loc) · 605 Bytes / Copy pathtmp.pyFile metadata and controls23 lines (18 loc) · 605 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 import re bad_attrs = ['width', 'height', 'style', '[-a-z]*color', 'background[-a-z]*', 'on*'] single_quoted = "'[^']+'" double_quoted = '"[^"]+"' non_space = '[^ "\'>]+' h = re.compile("<" # open "([^>]+) " # prefix "(?:%s) *" % ('|'.join(bad_attrs),) + # undesirable attributes '= *(?:%s|%s|%s)' % (non_space, single_quoted, double_quoted) + # value "([^>]*)" # postfix ">" # end , re.I) if __name__ == "__main__": html = "<xiaojie xiaojie width='aaa' >" r = h.sub("acv",html) print(r) p = re.compile("\d") print(p.sub("d","aaa3aaa4aaa543aaa4")) |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |