Skip to content

Instantly share code, notes, and snippets.

@slimane
Last active December 31, 2015 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slimane/8052059 to your computer and use it in GitHub Desktop.
Save slimane/8052059 to your computer and use it in GitHub Desktop.
Function REGMATCH(target As String, pattern As String, Optional g As Boolean = False, Optional ignoreCase As Boolean = False, Optional multiLine As Boolean = False) As Boolean
If Len(pattern) = 0 Then
REGMATCH = False
Exit Function
End If
Dim r As New RegExp
With r
.multiLine = multiLine
.Global = g
.ignoreCase = ignoreCase
.pattern = pattern
End With
REGMATCH = r.Test(target)
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment