Skip to content

Instantly share code, notes, and snippets.

@chhetripradeep
Last active October 8, 2017 17:43
Show Gist options
  • Save chhetripradeep/99e89b967305ea7ec048bbc7f2f7af7d to your computer and use it in GitHub Desktop.
Save chhetripradeep/99e89b967305ea7ec048bbc7f2f7af7d to your computer and use it in GitHub Desktop.
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