This question shows research effort; it is useful and clear
0
This question does not show any research effort; it is unclear or not useful
Bookmark this question.
Show activity on this post.
这是我的代码:
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