File: regex.lua

package info (click to toggle)
luabind 0.9.1%2Bdfsg-5
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 1,460 kB
  • sloc: cpp: 13,761; makefile: 120; sh: 24; ansic: 11
file content (12 lines) | stat: -rw-r--r-- 235 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12

html_tag = regex("<(.*?)>")
src = '<html>dadas<head>dsa</head></html>'

while html_tag:search(src) do
	print('tag: ' .. html_tag:what(1))
	src = string.sub(src, html_tag:position(0) + html_tag:length(0))
end

print('-------------')