Skip to content

Instantly share code, notes, and snippets.

@pandanote-info
Created May 27, 2022 01:37
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
正規表現を用いて文字列の置換を行うためのVBAのプログラム例
Sub regexp_test()
Dim reg As Object
Set reg = CreateObject("VBScript.RegExp")
reg.Global = True
reg.Pattern = "^([^\(]+)\(([^\)]+)\)"
Dim output As String
output = reg.Replace("京急1000形1890番台(Le Ciel)", "$2 $1")
Debug.Print output
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment