I'm trying to create a regex that will matches with
"8-9."
but won't matches with
"8-9........"
I tried lots of possibilities yet, but still can't find the right one.
I'm trying to create a regex that will matches with
"8-9."
but won't matches with
"8-9........"
I tried lots of possibilities yet, but still can't find the right one.
try
Dim r As Regex = New Regex("8\-9")
'Look for match
Dim m As Match = r.Match(mystring)
also might use
Dim r As Regex = New Regex("^8\-9$")
if you want a single word
- has no special meaning unless it's used inside a character class (e.g. [a-z]).x As Y = new Y… should always be replaced by x As New Y….var? I've always wondered.var is Dim without a data type, when Option Infer is enabled. So just Dim x = "Hello". However, due to the above-mentioned syntax shortcut, this is less often necessary than var in C#.