fork(7) download
  1. function getmatches(text)
  2. for line in string.gmatch(text, "[^\r\n]+") do
  3. m,n = string.match(line,"^dhcp%-range[^,]*,([^,]+),([^,]+)")
  4. if m ~= nil then
  5. print(m,n)
  6. end
  7. end
  8. end
  9.  
  10. s = [[dhcp-leasefile=/tmp/dhcp.leases
  11. resolv-file=/tmp/resolv.conf.auto
  12. addn-hosts=/tmp/hosts
  13. conf-dir=/tmp/dnsmasq.d
  14. stop-dns-rebind
  15. rebind-localhost-ok
  16. dhcp-broadcast=tag:needs-broadcast
  17.  
  18. dhcp-range=lan,192.168.34.165,192.168.34.179,255.255.255.0,12h
  19. no-dhcp-interface=eth0]]
  20.  
  21. getmatches(s)
  22.  
Success #stdin #stdout 0s 14104KB
stdin
Standard input is empty
stdout
192.168.34.165	192.168.34.179