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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find IP address in application configuration files
Expression
[\\""=/>](25[0-4]|2[0-4][0-9]|1\d{2}|\d{2})\.((25[0-4]|2[0-4][0-9]|1\d{2}|\d{1,2})\.){2}(25[0-4]|2[0-4][0-9]|1\d{2}|\d{2}|[1-9])\b[\\""=:;,/<]
Description
This expression is ideal used for "identifying some plain application configuration files that contain any form of ip addresses, with or without port number followed and with protocol at the beginning". [\\""=/] can be removed on both ends to seach IPs in text files, but with it, it has better accuracy - there are version numbers in the application configuration files. It also does not match IPs that have one digit at the first number.
Matches
/172.21.134.89: /127.0.0.1: "14.14.14.14"
Non-Matches
"255.255.255.255" "243.243.2.0" "2.222.222.222" /2224.2224.2224.2224:
Author Rating: Not yet rated. BH
Source Myself
Your Rating
Bad Good

Enter New Comment

Title
 
Name
 
Comment
 
Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

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