Python-Regex der Gruppenübereinstimmung
Hier ist mein 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
Es funktioniert nicht, wie kann ich das beheben?
Meine Python-Version ist 2.6.5