Closed spanezz closed 4 years ago
Another option, is to decide that if the path
argument starts with ^
or ends with $
, then it's a regexp. I recall seeing some other software do it, although I don't recall which one.
One can still provide the regex()
function to the templates, for explicit marking.
On Sun, Dec 15, 2019 at 04:37:01AM -0800, Enrico Zini wrote:
[…] if the
path
argument starts with^
or ends with$
, then it's a regexp. I recall seeing some other software do it […]
cough apt cough
Sort of at least: on the commandline it is more accepting (just needs to look
roughly like a regex to be tried as such – would personally prefer if it
would only act on ^
Long story short, would work & would have been my alternative suggestion if I hadn't forgotten about it at the time I wrote the reply.
Aah, right! (I really couldn't remember that apt did it!) So from your experience not only it's a viable option, but it didn't have particular downsides so far. I think we have a winner.
(From a conversation wtih @DonKult)
Ok. Let's try and accept a regexp object for path, and export a
regex()
function to the templates.