次の文字列をすべて '\x000'、'\x001'、'\x002' で分割する方法は? 次のような正規表現を試してみましたが、うまくいきませんでした!
z = re.compile(r'[\x000\x001\x002\x003\x004\x005]:')
line = '114.37.114.95 - - [16/Jul/2012:03:22:37 -0700] "GET /query?dest=adjustable_layout&from_url=http%3A%2F%2Fwww.nownews.com%2F&referer=&width=300&height=330&api_version=1 HTTP/1.1" 200 10481 "http://www.nownews.com/" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Foxy/1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; yie8)"\x000:1342434156.712809 get_cache http://www.nownews.com/\x000:1342434156.717942 Cache Hits agtzfnRhZ3Rvby1lY3IjCxIGTmV3c0FkIhdodHRwOi8vd3d3Lm5vd25ld3MuY29tLww\x000:1342434156.731564 new version\x001:1342434156.732352 display:[(u\'1\', u\'114\', u\'29\'), (u\'1\', u\'114\', u\'29\'), (u\'1\', u\'114\', u\'13\'), (u\'1\', u\'114\', u\'21\'), (u\'1\', u\'114\', u\'24\'), (u\'1\', u\'114\', u\'13\'), (u\'1\', u\'114\', u\'29\'), (u\'1\', u\'114\', u\'29\'), (u\'1\', u\'114\', u\'21\'), (u\'1\', u\'114\', u\'13\'), (u\'1\', u\'114\', u\'29\'), (u\'1\', u\'114\', u\'24\'), (u\'1\', u\'114\', u\'13\'), (u\'1\', u\'114\', u\'21\'), (u\'1\', u\'114\', u\'29\'), (u\'1\', u\'114\', u\'13\'), (u\'1\', u\'114\', u\'21\'), (u\'1\', u\'114\', u\'24\'), (u\'1\', u\'114\', u\'26\'), (u\'1\', u\'114\', u\'13\')]'
z.split(line)
編集1
文字列には \x000、\x001、\x002.... があります。これらの文字で文字列を分割したい。
予想される出力は次のようになります。
['114.37.114.95 - - [16/Jul/2012:03:22:37 -0700] "GET /query?dest=adjustable_layout&from_url=http%3A%2F%2Fwww.nownews.com%2F&referer=&width=300&height=330&api_version=1 HTTP/1.1" 200 10481 "http://www.nownews.com/" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Foxy/1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; yie8)"', '\x000:1342434156.712809 get_cache http://www.nownews.com/', '\x000:1342434156.717942 Cache Hits agtzfnRhZ3Rvby1lY3IjCxIGTmV3c0FkIhdodHRwOi8vd3d3Lm5vd25ld3MuY29tLww', '\x000:1342434156.731564 new version', '\x001:1342434156.732352 display:[(u\'1\', u\'114\', u\'29\'), (u\'1\', u\'114\', u\'29\'), (u\'1\', u\'114\', u\'13\'), (u\'1\', u\'114\', u\'21\'), (u\'1\', u\'114\', u\'24\'), (u\'1\', u\'114\', u\'13\'), (u\'1\', u\'114\', u\'29\'), (u\'1\', u\'114\', u\'29\'), (u\'1\', u\'114\', u\'21\'), (u\'1\', u\'114\', u\'13\'), (u\'1\', u\'114\', u\'29\'), (u\'1\', u\'114\', u\'24\'), (u\'1\', u\'114\', u\'13\'), (u\'1\', u\'114\', u\'21\'), (u\'1\', u\'114\', u\'29\'), (u\'1\', u\'114\', u\'13\'), (u\'1\', u\'114\', u\'21\'), (u\'1\', u\'114\', u\'24\'), (u\'1\', u\'114\', u\'26\'), (u\'1\', u\'114\', u\'13\')]']