Hi Peter ! :O)
Do you really need a regular expression ?
There many ways to perform this test... here's three of them including a
Regex solution.. :
'***
Dim s As String = "my / test / string"
Console.WriteLine(s.Split("/").Length - 1 = 2)
Console.WriteLine(s.Length - s.Replace("/", "").Length = 2)
Console.WriteLine(Regex.IsMatch(s, "^([^/]*)/{1}([^/]*)/{1}([^/]*)$"))
'***
--
Best Regards
Yanick
"Peter Smith" <Pe*********@hotmail.com> a écrit dans le message de
news:uI**************@TK2MSFTNGP14.phx.gbl...
I am writing some validations code to make sure that date string data has
only two "/" characters in a string. Order of appearance of "/" is
irrespective.
How to write a regular expressions code to validate that a given string
has only two "/" in a given string. .Net 1.1.
Thanks,
Smith