mirror of
https://github.com/msva/lua-htmlparser.git
synced 2024-11-27 12:44:22 +00:00
the selctor patterns explained
This commit is contained in:
parent
591e7ebc8b
commit
77f24f93be
@ -107,7 +107,11 @@ local function select(self, s)
|
|||||||
end
|
end
|
||||||
if part == "*" then goto nextpart end
|
if part == "*" then goto nextpart end
|
||||||
local excludes, filter = Set:new()
|
local excludes, filter = Set:new()
|
||||||
for t, w in string.gmatch(part, "([:%[#.]?)([^:%(%[#.%]%)]+)%]?%)?") do
|
for t, w in string.gmatch(part,
|
||||||
|
"([:%[#.]?)" .. -- t = an optional :, [, #, or .
|
||||||
|
"([^:%(%[#.%]%)]+)" .. -- w = 1 or more of anything not :, (, [, #, ., ], or )
|
||||||
|
"%]?%)?" -- followed by an uncaptured optional ] and/or )
|
||||||
|
) do
|
||||||
if t == ":" then filter = w goto nextw end
|
if t == ":" then filter = w goto nextw end
|
||||||
local match = sets[t][w]
|
local match = sets[t][w]
|
||||||
if filter == "not" then
|
if filter == "not" then
|
||||||
|
Loading…
Reference in New Issue
Block a user