From LedHed's Wiki
Jump to: navigation, search
(Created page with "== Overview == Here are some common examples of Regex used for form validation. == Phone Numbers == == Email Addresses == == IP Address Validation == === IPv4 Address ===...")
 
(No difference)

Latest revision as of 11:21, 14 July 2022

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