IP Address Validation with REGEX
You can use REGEX control below;
"^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}$"
For using this code in Windows Applications;
string text = "127.0.0.1";
string regex= @"^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}$";
Regex regexCheck = new Regex(regex);
bool valid = regexCheck.IsMatch(text, 0);
İlişkili Yazılar :
Tags: IP Address, REGEX, Regular Expression
Posted in Yazılım | No Comments »
| Önceki Yazı << Biztalk 2009 : SQLBinding – 4 – Orchestration | Sonraki Yazı >> İyi Bayramlar!!! |



