Created
August 20, 2024 19:52
-
-
Save dextercd/c0bb43e0fa900848d585c780097acd95 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
local stringify = dofile_once("mods/component-explorer/deps/datadumper.lua") | |
if not pat_init then | |
pat_init = true | |
pattern = "" | |
sample = "" | |
end | |
if not imgui.Begin("Pattern") then return end | |
_, pattern = imgui.InputText("Pattern", pattern) | |
_, sample = imgui.InputTextMultiline("##sample", sample, -1, 7 * imgui.GetTextLineHeight()) | |
local result = {pcall(string.match, sample, pattern)} | |
if not result[1] then | |
imgui.Text("Error: " .. result[2]) | |
else | |
imgui.Text("Result (" .. #result - 1 .. ")") | |
for i=2,#result do | |
imgui.Bullet() imgui.Text(result[i]) | |
end | |
end | |
imgui.End() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment