2
我有以下行:如何正則表達式匹配?
mystr = "1A) Monkey Hoop Jumping (MHJ) and Ring Toss (.50 Cents [YEAR2010]; .25 Cents [YEAR2016]) - The performance is estimated to be cheaper (MHJ;)"
mygroups = re.match('<match expression>', mystr)
我如何用Python語言編寫一個匹配表達式「重」來獲得以下幾組?
line = "1A"
activity = "Monkey Hoop Jumping (MHJ) and Ring Toss"
costin2010 = ".50"
我試過以下,它不工作:
(?P<line>.+?)\) (?P<activity>.*?) \((?P<costin2010>[\d.]+ Cents [YEAR2010].*?)