我想使用正則表達式在Python中像這樣正則表達式的數字賦值給變量
6 8 text text 8 text 10 text
匹配和編號分配到單獨的數組變量有沒有辦法挑選基於關閉的順序他們陷入這樣的:
num1[i] = \d{1,2} should be just the 6
num1[i] = \d{1,2} should be just the 8
num1[i] = \d{1,2} should be just the second 8
num1[i] = \d{1,2} should be just the 10
請給予更多解釋和細節,例如有預期結果的樣本輸入的幾個例子。 – Yunnosch