I\'m trying to use a RegularexpressionValidator to match an IP address (with possible wildcards) for an IP filtering system.
I\'m using the following Regex:
This: \\.|\\*\\. looks like the dodgy bit. Do this instead:
\\.|\\*\\.
@"^(([0-9]{1,3}|\*)\.){3}([0-9]{1,3}|\*)$"
And to only accept 0-255 (thanks, apoorv020):
^((([0-9]{1,2})|(1[0-9]{2,2})|(2[0-4][0-9])|(25[0-5])|\*)\.){3}(([0-9]{1,2})|(1[0-9]{2,2})|(2[0-4][0-9])|(25[0-5])|\*)$