27 Aug
2021
27 Aug
'21
8:53 p.m.
Dear list, I have the following sample: \starttext \startluacode url = "../a/b/cb/ce.b/ca.b/c/dabc.pdf" context(url) context("\\\\0 ok. " .. url:match "^(.*).pdf$") -- name and path context("\\\\1. " .. url:match "^(.*).+$") -- path context("\\\\2. " .. url:match"[^/]+[.$]") -- name context("\\\\3 ok. " .. url:match "[^.]+$") -- extension \stopluacode \stoptext How can I get that match for #1 ends in the last slash (including it "../a/b/cb/ce.b/ca.b/c/") and match for #2 ends in the last period (excluding it, "dabc")? Many thanks for your help, Pablo -- http://www.ousia.tk