diff options
author | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2013-06-28 23:50:18 +0300 |
---|---|---|
committer | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2013-09-04 15:24:08 +0300 |
commit | 4c1cc6f54edc35a4aa2f1553bc9ce372a2b77695 (patch) | |
tree | d4142961891040a433add8ea3d350be4c6d58471 /acf/model/net.lua | |
parent | 25ffc62a5b2c9a65e5c1689d5351adcf8cbef7e2 (diff) | |
download | aconf-4c1cc6f54edc35a4aa2f1553bc9ce372a2b77695.tar.bz2 aconf-4c1cc6f54edc35a4aa2f1553bc9ce372a2b77695.tar.xz |
eliminate explicit use of string module
Diffstat (limited to 'acf/model/net.lua')
-rw-r--r-- | acf/model/net.lua | 4 |
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] == '' |