I can’t seem to get the proper RegEx for validating an IP address, including support for a wildcard char (*), which can occur only at the end. For example:
Valid
1.2.*
1.2.3.*
1.2.3.4
Not Valid
1
1.2
1.2*
1.2.3
1.2.3*
1.*.3.4
I’ve come close (and found a few similar questions/answers here), but can’t get all of the scenarios to pass/fail. Can anyone help me out? BTW – validating octets are 0-255 isn’t necessary, but would be cool.
something like this:
second edition: