Fix up the tests and some minor bugs

This commit is contained in:
2025-03-28 00:51:26 +01:00
parent bfd08e754e
commit 1f6c4e4976
2 changed files with 5 additions and 64 deletions

View File

@@ -281,7 +281,7 @@ func resolveRegexPlaceholders(pattern string) string {
replacement := `-?\d*\.?\d+`
return parts[1] + replacement
})
pattern = strings.ReplaceAll(pattern, "!num", `"?(-?\d*\.?\d+)"?`)
pattern = strings.ReplaceAll(pattern, "!num", `(-?\d*\.?\d+)`)
pattern = strings.ReplaceAll(pattern, "!any", `.*?`)
repPattern := regexp.MustCompile(`!rep\(([^,]+),\s*(\d+)\)`)
// !rep(pattern, count) repeats the pattern n times