Quote:
I want to validate "IncludedColumns" with regExp to get only integer values.
I'd say: try to add value different than integer to find out what happens...
Quote:
"Ladder" is a string field which must receive values like this: "23,47,71,95". I want to validate "Ladder" with regExp so if after each two digits comma is missing to have error message
Try this and change to your needs:
Dim ladders As String()= {"23,47,71,95", "23,47.71,95", "23,47,71 95"}
Dim pattern As String = "^\d{2},\d{2},\d{2},\d{2}$"
For Each lad As String In ladders
Console.WriteLine("{0} => {1}", lad, Regex.IsMatch(lad, pattern))
Next
string[] ladders = {"23,47,71,95", "23,47.71,95", "23,47,71 95"};
string pattern = @"^\d{2},\d{2},\d{2},\d{2}$";
foreach(string lad in ladders)
{
Console.WriteLine("{0} => {1}", lad, Regex.IsMatch(lad, pattern));
}
Result:
23,47,71,95 => True
23,47.71,95 => False
23,47,71 95 => False