Here is my code:
import re
pattern_str = '(?P<style>[^|]*>)\|(?P<tags>[^|]*)'
p = re.compile(pattern_str)
m = p.match('OL|AAAAA')
a = m.group('style') # AttributeError: 'NoneType' object has no attribute 'group'
print a
It doesn't work, how to fix it?
My python version is 2.6.5