Check whether text is a dotted-quad IPv4 address.
The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.
Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.
The pattern checks four dot-separated decimal octets with bounded values and anchors the complete input. It targets IPv4 text, not IPv6 or CIDR.
ipv4
IP Regex (ipv4):
^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$
IPv4 address (e.g., 192.168.1.1)
Firewall forms, log filters, and allowlist editors check IPv4 text.