diff options
author | Karl Berry <karl@freefriends.org> | 2019-07-14 20:48:50 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-07-14 20:48:50 +0000 |
commit | 03b40659365a55ac7b166e6d8afe7dcf94047115 (patch) | |
tree | 41fc3ac8a6e0023ec7bb02ade93b05c594a33701 /Master/texmf-dist/tex/luatex/lualibs/lualibs-string.lua | |
parent | 43f963c6e7c57e4278ebb7644cef82b408d66f95 (diff) |
lualibs (14jul19)
git-svn-id: svn://tug.org/texlive/trunk@51642 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/lualibs/lualibs-string.lua')
-rw-r--r-- | Master/texmf-dist/tex/luatex/lualibs/lualibs-string.lua | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/luatex/lualibs/lualibs-string.lua b/Master/texmf-dist/tex/luatex/lualibs/lualibs-string.lua index 8ae8d8d1d76..1dee85e2894 100644 --- a/Master/texmf-dist/tex/luatex/lualibs/lualibs-string.lua +++ b/Master/texmf-dist/tex/luatex/lualibs/lualibs-string.lua @@ -155,11 +155,13 @@ end --- needs checking local anything = patterns.anything -local allescapes = Cc("%") * S(".-+%?()[]*") -- also {} and ^$ ? -local someescapes = Cc("%") * S(".-+%()[]") -- also {} and ^$ ? -local matchescapes = Cc(".") * S("*?") -- wildcard and single match +local moreescapes = Cc("%") * S(".-+%?()[]*$^{}") +local allescapes = Cc("%") * S(".-+%?()[]*") -- also {} and ^$ ? +local someescapes = Cc("%") * S(".-+%()[]") -- also {} and ^$ ? +local matchescapes = Cc(".") * S("*?") -- wildcard and single match -local pattern_a = Cs ( ( allescapes + anything )^0 ) +local pattern_m = Cs ( ( moreescapes + anything )^0 ) +local pattern_a = Cs ( ( allescapes + anything )^0 ) local pattern_b = Cs ( ( someescapes + matchescapes + anything )^0 ) local pattern_c = Cs ( Cc("^") * ( someescapes + matchescapes + anything )^0 * Cc("$") ) @@ -170,6 +172,8 @@ end function string.topattern(str,lowercase,strict) if str == "" or type(str) ~= "string" then return ".*" + elseif strict == "all" then + str = lpegmatch(pattern_m,str) elseif strict then str = lpegmatch(pattern_c,str) else |