local i="\092\046"local F="\092\043"local r="\092\063"local G="\092\047"local h="\040\063\061\046\041"local A="\091\094\047\093"local X=("\040\063\058\037\115\124\036\041"):format(G)local C=("\040\063\058\094\124\037\115\041"):format(G)local W=("\037\115\123\049\044\050\125\037\115"):format(i,X)local E=("\040\063\033\037\115\041"):format(i)local v=("\040\063\033\037\115\037\115\041"):format(C,W)local q=("\040\063\033\037\115\123\048\044\049\125\037\115\041"):format(i,X)local l=("\040\063\033\037\115\041"):format(W)local H=("\091\094\046\037\115\093"):format(G)local R=("\037\115\042\063"):format(A)local D={DOT_LITERAL=i;PLUS_LITERAL=F,QMARK_LITERAL=r,SLASH_LITERAL=G,ONE_CHAR=h;QMARK=A,END_ANCHOR=X,DOTS_SLASH=W,NO_DOT=E;NO_DOTS=v,NO_DOT_SLASH=q,NO_DOTS_SLASH=l,QMARK_NO_DOT=H,STAR=R;START_ANCHOR=C}
--[[*
 * Posix glob regex
 ]]
local DOT_LITERAL = "\\."
local PLUS_LITERAL = "\\+"
local QMARK_LITERAL = "\\?"
local SLASH_LITERAL = "\\/"
local ONE_CHAR = "(?=.)"
local QMARK = "[^/]"
local END_ANCHOR = ("(?:%s|$)"):format(SLASH_LITERAL)
local START_ANCHOR = ("(?:^|%s)"):format(SLASH_LITERAL)
local DOTS_SLASH = ("%s{1,2}%s"):format(DOT_LITERAL, END_ANCHOR)
local NO_DOT = ("(?!%s)"):format(DOT_LITERAL)
local NO_DOTS = ("(?!%s%s)"):format(START_ANCHOR, DOTS_SLASH)
local NO_DOT_SLASH = ("(?!%s{0,1}%s)"):format(DOT_LITERAL, END_ANCHOR)
local NO_DOTS_SLASH = ("(?!%s)"):format(DOTS_SLASH)
local QMARK_NO_DOT = ("[^.%s]"):format(SLASH_LITERAL)
local STAR = ("%s*?"):format(QMARK)
local POSIX_CHARS = {
	DOT_LITERAL = DOT_LITERAL,
	PLUS_LITERAL = PLUS_LITERAL,
	QMARK_LITERAL = QMARK_LITERAL,
	SLASH_LITERAL = SLASH_LITERAL,
	ONE_CHAR = ONE_CHAR,
	QMARK = QMARK,
	END_ANCHOR = END_ANCHOR,
	DOTS_SLASH = DOTS_SLASH,
	NO_DOT = NO_DOT,
	NO_DOTS = NO_DOTS,
	NO_DOT_SLASH = NO_DOT_SLASH,
	NO_DOTS_SLASH = NO_DOTS_SLASH,
	QMARK_NO_DOT = QMARK_NO_DOT,
	STAR = STAR,
	START_ANCHOR = START_ANCHOR,
}
