On Sat, Sep 3, 2022 at 9:50 PM Ralph Mellor <ralphdjmel...@gmail.com> wrote: > > .put for [\~] '/A/B/C' ~~ m:g { '/'? <-[/]>+ }
That won't match just a slash (`/`). Maybe: .put for [\~] '/A/B/C' ~~ m:g { ('/'? <-[/]>*) <?{~$0}> } And it'll treat `/a/b` and `/a/b/` as distinct if the input string is `/a/b/`. -- raiph