From LedHed's Wiki
Revision as of 11:21, 14 July 2022 by Ledhed (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Overview

Here are some common examples of Regex used for form validation.

Phone Numbers

Email Addresses

IP Address Validation

IPv4 Address

^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$


IPv4 Subnet in CIDR Notation

^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)($|/([0-9]|[12][0-9]|3[0-2]))$


References

https://www.regextester.com/

https://www.regextutorial.org/regex-for-ip-address-match.php

https://stackoverflow.com/questions/12141206/ipaddress-or-cidr-block-matching-regex