RSSArchive

YNB's not blog

30
Jun

Excelでsed s/re/sub/gしてー

って思ってMicrosoft VBScript Regular Expressions 5.5を使ってしょうもないマクロを書いた。

Public Function RegSub(strTarget As String, strPattern As String, strSub As String, Optional blnGlobal As Boolean = False, Optional blnIgnoreCase As BookmarkEnum = False) As String
    Dim re As RegExp
   
    Set re = New RegExp
    re.Global = blnGlobal
    re.IgnoreCase = blnIgnoreCase
    re.Pattern = strPattern
    RegSub = re.Replace(strTarget, strSub)
End Function

便利!

Page 1 of 1