summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/l-string.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2019-07-04 13:50:48 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2019-07-04 13:50:48 +0200
commit4bc28891615011ed3581836e9259434720e25830 (patch)
tree4a753013e7b1e5b83a76c2708939d40b13972240 /tex/context/base/mkiv/l-string.lua
parent739710f590371de17ae0debb4dc38b0de270b9f3 (diff)
downloadcontext-4bc28891615011ed3581836e9259434720e25830.tar.gz
2019-07-04 12:36:00
Diffstat (limited to 'tex/context/base/mkiv/l-string.lua')
-rw-r--r--tex/context/base/mkiv/l-string.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/tex/context/base/mkiv/l-string.lua b/tex/context/base/mkiv/l-string.lua
index 8ae8d8d1d..1dee85e28 100644
--- a/tex/context/base/mkiv/l-string.lua
+++ b/tex/context/base/mkiv/l-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