I am new to Python and stackoverflow, very new.
I want to extract the destination port:
2629 > 0 [SYN] Seq=0 Win=512 Len=100
0 > 2629 [RST, ACK] Seq=1 Ack=1 Win=0 Len=0
0 > 2633 [RST, ACK] Seq=1 Ack=1 Win=0 Len=0
I want to retrieve destination ports for every line: '0' , '2629', '2633' using python regex and ignore the rest (the number that appears after '>' and before '['.
re.findall("\d\d\d\d\d|\d\d\d\d|\d\d\d|\d\d|\d", str)
but this is very generic one. What is the best regex for such scenario?