Good morning.
I am new to Regular Expressions, and I am trying to validate a number like 012345-1234. I have the following:
My code works, but I was hoping there was a better (shorter experession) way where it could be more recursive.
Thank you for looking, WHEELS
I am new to Regular Expressions, and I am trying to validate a number like 012345-1234. I have the following:
Code:
Public Function ValidNumber(ByVal strNumber As String) As Boolean
With CreateObject("VBScript.RegExp")
.IgnoreCase = True
.Global = True
.Pattern = "^([0-9][0-9][0-9][0-9][0-9][0-9])-([0-9][0-9][0-9][0-9])$"
ValidNumber = .Test(strNumber)
End With
End Function
My code works, but I was hoping there was a better (shorter experession) way where it could be more recursive.
Thank you for looking, WHEELS