Part of me reads these things and I'm like "neat trick", but most of the time they more-or-less prove to me that Regex is doomed to a steady and slow decline.
It's just not a particularly good "interface" for the task it is intended to achieve, a little more ability to be "verbose" at the possible price of succinctness I think would go a long way. I'm more-or-less waiting for the "blank" in: "blank" is to Python what Regex is to Perl.
Just like programming tricks in any language supported by copilot:
a. Code, once provided, can be broken down and understood at a far easier level than is required for composition;
b. Worst case, try several test cases to both increase comprehension and reduce the chance of 'gottcha's.
Shouldn't be too hard to stick with option 'a' as clear best practice, looking up any operators or syntax that aren't immediately obvious, the advantage being that the AI can use obscure tricks that you aren't initially aware of but you still have the opportunity to review and understand the regex, becoming better over time. It's theoretically auto-generated, but practically computer-assisted.
Smartass answers only. Ask autopilot to write a proof with --nojargon so juniors will get it! Write a single unit test and call it good! Step through it in a debugger on that one unit test to be sure? Sure of what? I dunno but it sounds diligent...
When I watched Idiocracy, a small optimist in me said "but surely the techies..." That optimist has died. We're fucked
Probably the way most people do - they run it over whatever examples they can think of at the moment as a check, and then forget about it till it breaks.
> I'm more-or-less waiting for the "blank" in: "blank" is to Python what Regex is to Perl.
This will sound like a forced joke but I genuinely didn't understand your phrase. I got stuck re-reading several times the "blank" in: "blank" part, but my mental language regex wasn't matching the expression.
I think the bug is caused by a bogus quote that causes a bad parameter expansion. My regex engine parses this better: the "blank" in: "blank is to Python what Regex is to Perl"
It's just not a particularly good "interface" for the task it is intended to achieve, a little more ability to be "verbose" at the possible price of succinctness I think would go a long way. I'm more-or-less waiting for the "blank" in: "blank" is to Python what Regex is to Perl.