I'm trying to figure out the best way to create a regex rule that works for both the IPv4 and IPv6 address space when the format is:
[2a00:1397:4:2a02::a1]:50434
129.13.252.47:13456
I'm close, but basically, I need the match to be on the very last colon character (right before the port), rather than matching the rest of the line, as I don't want to discard the port value. The idea is the last colon character is a delimiter.
I currently have the following regex :[^:]+$
which basically gets me the last colon character but matches the port value as well. I need the match to stop at the colon character. Is this possible?