summaryrefslogtreecommitdiffstats
path: root/acf/model/net.lua
diff options
context:
space:
mode:
Diffstat (limited to 'acf/model/net.lua')
-rw-r--r--acf/model/net.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/acf/model/net.lua b/acf/model/net.lua
index e5c1836..ae82f1e 100644
--- a/acf/model/net.lua
+++ b/acf/model/net.lua
@@ -31,7 +31,7 @@ function M.IPv4Address:validate(context, value)
if tonumber(octet) > 255 then return true end
end
end
- if test(string.match(value, '^(%d+)%.(%d+)%.(%d+)%.(%d+)$')) then
+ if test(value:match('^(%d+)%.(%d+)%.(%d+)%.(%d+)$')) then
raise(context.path, 'Invalid IPv4 address')
end
end
@@ -63,7 +63,7 @@ function M.IPv6Address:validate(context, value)
if comp == '' then
if short then invalid() end
short = true
- elseif not string.match(comp, '^%x%x?%x?%x?$') then invalid() end
+ elseif not comp:match('^%x%x?%x?%x?$') then invalid() end
end
if (
short and #comps == 3 and comps[2] == ''