LoginSignup
0
0

More than 5 years have passed since last update.

smallbasicでregex

Posted at

自前のエクステンション使います。

サンプル

GraphicsWindow.BackgroundColor = "skyblue"
button = Controls.AddButton("run", 200, 100)
Controls.ButtonClicked = onclick
Sub onclick
  C = Text.GetCharacter(34)
  R = Text.GetCharacter(13) + Text.GetCharacter(10)
  code = ""
  code = code + "Function setup(a)" + R 
  code = code + "set reg = createObject(" + C + "VBScript.RegExp" + C + ")" + R
  code = code + "reg.pattern = " + C + "a(.)c" + C + R
  code = code + "set mc = reg.execute(" + C + "abc" + C + ")" + R
  code = code + "if mc.count > 0 then" + R
  code = code + "set smc = mc.item(0).submatches" + R
  code = code + "msgbox smc.item(0)" + R
  code = code + "setup = smc.item(0)" + R
  code = code + "end if" + R
  code = code + "End Function" + R
  a = Class1.VBSrun(code)
EndSub

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0