Created
May 27, 2022 01:37
-
-
Save pandanote-info/3816b4b043ebaadb2bd6f9353efee4da to your computer and use it in GitHub Desktop.
正規表現を用いて文字列の置換を行うためのVBAのプログラム例
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
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