I had problem to detect input with pattern for ip address v4 with optional port
I had found just pattern for ip address v4 only
this is code only for ipv4
/\b(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\b/
i'd expected regex can read, example: 192.168.11.11 or 192.168.11.11:8000