Created
July 3, 2012 11:46
-
-
Save shiweifu/3039265 to your computer and use it in GitHub Desktop.
lua parser youku video
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function main() | |
regex = [[false"><a title="(.-)"%starget=".-"%shref="(.-)%.html"]] | |
f = io.open("test.html", "r") | |
html = f:read("*a") | |
f:close() | |
s_idx, e_idx, title, url = string.find(html, regex, 0) | |
while s_idx ~= nil do | |
print(title) | |
print(url) | |
print() | |
s_idx, e_idx, title, url = string.find(html, regex, e_idx) | |
end | |
--print(url) | |
end | |
main() | |
-- s = [[Deadline is 30/05/1999, "firm"]] | |
-- print(string.find(s,[[(.*)"(.*)"]])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment