Forum Discussion
hooleylist
Aug 22, 2007Cirrostratus
What is happening when you test your regex? Does it just not match, or do you get a TCL error in the LTM log file (/var/log/ltm). It is hard to see what you've used, as DC munges the characters.
Here are two options from regexbuddy:
I've attached them in a file in case DC munges the characters.
Do you want to capture the match in backreferences? The first option doesn't use backreferences, the second one does:
IP address
Matches 0.0.0.0 through 255.255.255.255
Use this regex to match IP numbers with accuracy, without access to the individual IP numbers.
\b(??: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]?)\b
IP address
Matches 0.0.0.0 through 255.255.255.255
Use this regex to match IP numbers with accuracy.
Each of the 4 numbers is stored into a capturing group, so you can access them for further processing.
\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b
Aaron