pythonで、正規表現を使って文字を抜き取りたいと思って作成した。 自分用のメモ書きです。
import re text = "*[13:0]*[23:14]*[25:24]" pattern = r'\*\[(\d+:\d+)\]' matches = re.findall(pattern,text) numbers = [] for match in matches: start,end = match.split(':') numbers.append([int(start),int(end)]) print (numbers)