Created
August 16, 2011 21:30
-
-
Save jonschoning/1150224 to your computer and use it in GitHub Desktop.
regex.bas
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
Attribute VB_Name = "Module1" | |
Function RegexMatch(Value As String, Pattern As String, Optional IgnoreCase As Boolean = False) | |
Dim r As New VBScript_RegExp_55.RegExp | |
r.Pattern = Pattern | |
r.IgnoreCase = IgnoreCase | |
RegexMatch = r.Test(Value) | |
End Function | |
Function RegexReplace(Value As String, Pattern As String, ReplaceWith As String, Optional IgnoreCase As Boolean = False) | |
Dim r As New VBScript_RegExp_55.RegExp | |
r.Pattern = Pattern | |
r.IgnoreCase = IgnoreCase | |
r.Global = True | |
RegexReplace = r.Replace(Value, ReplaceWith) | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment