Shorthand for num

This commit is contained in:
2025-03-22 02:52:44 +01:00
parent 7467a4ef2e
commit b235e171ea

View File

@@ -57,6 +57,10 @@ func main() {
// Generate the Lua script
luaScript := buildLuaScript(luaExpr)
if strings.Contains(regexPattern, "!num") {
regexPattern = strings.ReplaceAll(regexPattern, "!num", "(\\d*\\.?\\d+)")
}
// Make sure the regex can match across multiple lines by adding (?s) flag
if !strings.HasPrefix(regexPattern, "(?s)") {
regexPattern = "(?s)" + regexPattern