Imports System.Test.RegularExpressions
Dim myRegExp as New RegEx("\d{5}-\d{2}")
if myRefExp.IsMatch(txtMe.Text) then
'** Is good
else
'** Is NOT good
End If
I just coped & tested, besides a few typos it worked for me.
Her's the "spell checked" code:
Code:
Imports System.Text.RegularExpressions
Dim myRegExp As New Regex("\d{5}-\d{2}")
If myRegExp.IsMatch(Me.txtRecordLength.Text) Then
MsgBox("PASSED")
'** Is good
Else
'** Is NOT good
MsgBox("FAILED")
End If
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.