Does anyone have any suggestions for my regex for IPv4. This does not completely validate an IPv4 address.
IPV4="^(|[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3})\|"
1.1.1.1 is ok, but 999.1.1.1 also validates :(
Thanks for the input
* UPDATE *
Based on DopeGhoti's input, here is where im at so far. I'm running into issues adding this into my larger regex. I am setting this regex equal to a variable and then combining it with another expression for IPv6 as well. There are a few things that I have added to the regex. For example a (|insert DopeGhoti regex here). This allows me to accept an empty IPv4 address too. I also added a \| at the end because the two addresses being checked by the one big regex are | delimited.
IPV4="^(|(?:(?: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]?)))\|"
REGEX="$IPV4$IPV6"
This process works with my simplier IPv4 regex. Something in the new regex is breaking it.
* UPDATE *
Ok weird. I tested the following in rubular:
http://rubular.com/r/c6J3sESDyN
^(|(?:(?: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]?)))\|$
This seems to work. Maybe I have another internal issue. Checking now.