Last active
October 8, 2017 17:43
-
-
Save chhetripradeep/99e89b967305ea7ec048bbc7f2f7af7d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Function check(text As String) As Boolean | |
Dim reg As Object | |
Set reg = CreateObject("vbscript.regexp") | |
Dim reg1 As Object | |
Set reg1 = CreateObject("vbscript.regexp") | |
reg.Pattern = "^[a-zA-Z][0-9]+$" | |
reg1.Pattern = "^TP[0-9]+$" | |
check = False | |
If text = "FOOBAR" Then | |
check = True | |
End If | |
If reg.Test(text) Then | |
check = True | |
End If | |
If reg1.Test(text) Then | |
check = True | |
End If | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment