Implement printing from lua

This commit is contained in:
2025-03-26 13:37:27 +01:00
parent 10c39b02a0
commit a9b6f7f984
3 changed files with 45 additions and 9 deletions

View File

@@ -1233,9 +1233,12 @@ func TestVariousNamedCaptureFormats(t *testing.T) {
p := &RegexProcessor{}
result, mods, matches, err := p.ProcessContent(
content,
`<entry id="(?<id_num>\d+)" value="(?<val>\d+)"(?: status="(?<status>[^"]*)")?`,
`<entry id="(?<id_num>\d+)" value="(?<val>\d+)"(?: status="(?<status>[^"]*)")? />`,
`-- Prefix the ID with "ID-"
id_num = "ID-" .. id_num
print(id_num)
print(val)
print(status)
-- Double the value except for inactive status
if not status or status ~= "inactive" then