$ python Python 2.4.4 (#2, Aug 16 2007, 02:03:40) [GCC 4.1.3 20070812 (prerelease) (Debian 4.1.2-15)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import re >>> raw = ''' 2007-10-02T18:16:25.707165Z After the colon are a space, 3 bad chars, 3 good chars, and a period: ?\021?\022?\017 . ''' ... ... ... ... ... ... ... ... >>> raw '\n\n\n2007-10-02T18:16:25.707165Z\nAfter the colon are a space, 3 bad chars, 3 good chars, and a period: ?\x11?\x12?\x0f\t\n .\n\n' >>> re.match(".*After the colon are a space, 3 bad chars, 3 good chars, and a period: \\?\\\\021\\?\\\\022\\?\\\\017 \n\\&\\#13;\\..*", raw) >>> re.match(".*After the colon are a space, 3 bad chars, 3 good chars, and a period: \\?\\\\021\\?\\\\022\\?\\\\017 \n\\&\\#13;\\..*", raw) >>> re.match(".*", raw) <_sre.SRE_Match object at 0xb7cccdb0> >>> re.match(".*After the colon are a space, 3 bad chars, 3 good chars, and a period: \\?\\\\021\\?\\\\022\\?\\\\017 \n\\&\\#13;\\..*", raw) >>> re.match(".*After the colon are a space, 3 bad chars, 3 good chars, and a period: .*", raw) >>> re.match(".*After the colon are a space, 3 bad chars, 3 good chars, and a period.*", raw) >>> re.match(".*After .*", raw) >>> re.match(".*After the colon are a space, 3 bad chars, 3 good chars, and a period: \\?\\\\021\\?\\\\022\\?\\\\017 \n\\&\\#13;\\..*", raw) >>> re.match(".*After the colon are a space, 3 bad chars, 3 good chars, and a period: \\?\\\\021\\?\\\\022\\?\\\\017 \n\\&\\#13;\\..*", raw) >>> re.match(".*After.*", raw) >>> re.match(".*fter.*", raw) >>> re.match(".*fter", raw) >>> re.match(".*fter.*$", raw) >>> re.match(".*fter.+", raw) >>> re.match(".*", raw) <_sre.SRE_Match object at 0xb7cdf288> >>> re.match("After.*", raw) >>> re.match(".*^After.*", raw) >>> re.match(".*^After", raw) >>> re.match("^After", raw) >>> re.match(".*.*", raw) >>> re.match(".*log", raw) >>> re.match(".*log.*", raw) >>> raw '\n\n\n2007-10-02T18:16:25.707165Z\nAfter the colon are a space, 3 bad chars, 3 good chars, and a period: ?\x11?\x12?\x0f\t\n .\n\n' >>> re.match(".*<\\?xml.*", raw) <_sre.SRE_Match object at 0xb7cccdb0> >>> re.match('.*<\\?xml version="1.0"\\?>.*', raw) <_sre.SRE_Match object at 0xb7cdf330> >>> re.match('.*<\\?xml version="1.0"\\?>\n.*', raw) <_sre.SRE_Match object at 0xb7cdf368> >>> re.match('.*<\\?xml version="1.0"\\?>\n.*', raw) <_sre.SRE_Match object at 0xb7cdf330> >>> re.match('.*<\\?xml version="1.0"\\?>.*', raw) <_sre.SRE_Match object at 0xb7cdf3a0> >>> re.match('.*<\\?xml version="1.0"\\?>.*', raw) >>> re.match("[\n.]*After the colon are a space, 3 bad chars, 3 good chars, and a period: \\?\\\\021\\?\\\\022\\?\\\\017 \n\\&\\#13;\\..*", raw) >>> re.match("(\n|.)*After the colon are a space, 3 bad chars, 3 good chars, and a period: \\?\\\\021\\?\\\\022\\?\\\\017 \n\\&\\#13;\\..*", raw) >>> re.match("(\n|.)*After the colon are a space, 3 bad chars, 3 good chars, and a period: \\?\\\\021\\?\\\\022\\?\\\\017 \n\\&\\#13;\\.(\n|.)*", raw) >>> re.match("\*\\?\\\\021\\?\\\\022\\?\\\\017.*", raw) >>> re.match(".*\\?\\\\021\\?\\\\022\\?\\\\017.*", raw) >>> re.match(".*\\?\\\\021\\?\\\\022\\?\\\\017.*", raw)