There is a line like this:
AAA 356 125 [654:11233:1123] 255 255 255 [123]: abc
You need to pull out of this line this part: 123 , which is in [123]:
123 can be any other number (but only a number), at least one-digit, and at most three-digit ( 5 , 999 , 0 , 88 , etc).
I can't figure out regular expressions, something goes wrong all the time.
line = 'AAA 356 125 [654:11233:1123] 255 255 255 [123]: abc' search = re.search('[(\d??)]:', line) # Пытался найти от 1 до 3 цифр между [ и ]: