<div dir="ltr"><div dir="ltr">On Thu, 7 Nov 2019 at 23:26, Anthony de Boer via talk <<a href="mailto:talk@gtalug.org">talk@gtalug.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Lennart Sorensen via talk wrote:<br>
> On Tue, Nov 05, 2019 at 06:42:44AM -0500, Giles Orr via talk wrote:<br>
> >  ...<br>
> > Jeez regex is a pain - it took three minutes of staring at that just to<br>
> > figure it out, even though I knew what we were both trying to achieve.<br>
> <br>
> Practice time!<br>
> <br>
> <a href="https://regexcrossword.com" rel="noreferrer" target="_blank">https://regexcrossword.com</a><br>
<br>
Oooh, fun!  The Hamlet puzzle took a few minutes to sort out.  But<br>
then I'm not a regular crossworder.<br>
<br>
One of the guys I work with claims that any use of regexen requires<br>
multiple lines of comment to explain, but I'm firmly of the opinion<br>
that being able to sight-read them is a basic Unix programming skill.<br>
</blockquote></div><div><br></div><div>Eyeballing simple regex is hard enough, but mentally parsing out a complex full line regex that looks like inline garbage without the benefit of comments isn't something I recommend or appreciate.  Some forms of regex support comments within the regex itself:<br></div><div><br></div><div><a href="https://www.regular-expressions.info/freespacing.html">https://www.regular-expressions.info/freespacing.html</a></div><div><br></div><div>However ... "Of the flavors discussed in this tutorial, only ... the POSIX and GNU flavors don't support it."  Which is where I most need it.  Of course, you can still make standard shell script comments before or after the 'sed' block, and I'm very much in favour of those.<br></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Giles<br><a href="https://www.gilesorr.com/" target="_blank">https://www.gilesorr.com/</a><br><a href="mailto:gilesorr@gmail.com" target="_blank">gilesorr@gmail.com</a></div></div>