<div dir="ltr"><div dir="ltr">I added a few more test cases to pcre_regex_to_append_path_non_redundantly.t, all of which your edit passes. Congrats! And thanks for the commented "/x" version. Indeed the "\s*" parts are not needed, I was guessing that the directories had optional whitespace around the separating colons. And maybe if I had started the task with the commented-extended-regex syntax, I would have caught the error!</div><div dir="ltr"><br></div><div dir="ltr">Odd, I didn't keep the window I tried out my answers in, and there's something in my memory that isn't in the solution I posted- I thought I explicitly matched the "secure_path" part on the left, which the "real world" use-case needs.</div><div dir="ltr"><br clear="all"><div><div dir="ltr" class="gmail_signature">-y<br></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 1, 2021 at 9:59 PM Joseph Brenner <<a href="mailto:doomvox@gmail.com">doomvox@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Yary:<br>
<br>
I really like your solution to Lambert's problem.  That idiom of<br>
using \K with a negative lookahead is a new one on me.<br>
<br>
I checked it against a few cases though, and I think it fails if<br>
the path is already there in the *first* position.  I tweaked it<br>
a bit and got an alternate version that deals with that:<br>
<br>
<a href="https://github.com/doomvox/raku-study/blob/main/bin/2021feb28/pcre_regex_to_append_path_non_redundantly.t" rel="noreferrer" target="_blank">https://github.com/doomvox/raku-study/blob/main/bin/2021feb28/pcre_regex_to_append_path_non_redundantly.t</a><br>
</blockquote></div>