RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details IP validator
Expression
/^(?:(?:1\d?\d|[1-9]?\d|2[0-4]\d|25[0-5])\.){3}(?:1\d?\d|[1-9]?\d|2[0-4]\d|25[0-5])$/
Description
It matches an IP address only in the correct format. There was a previous regex send which matches 192.168.01.2 but this code won't match preceeding 0's
Matches
192.168.1.2 | 127.0.0.1
Non-Matches
192.168.01.2 | 1921.68.1.2
Author Rating: The rating for this expression. snabbi
   Displaying page 1 of 1 pages; Items 1 to 1

Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials