summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/l-string.lua
diff options
context:
space:
mode:
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