4 ms·
I dream that we will have something like Copilot but exclusively for regex and working marvelously "Find every 2nd instance of a dollar amount that is not enca
by gota 5y ago
I dream that we will have something like Copilot but exclusively for regex and working marvelously
"Find every 2nd instance of a dollar amount that is not encased in quotes" outputting <insert regex here> would be awesome
- IgorPartola 5y agoPlease no. If you can’t understand the code, how can you possibly verify that what copilot or similar has produced is correct?
- meepmorp 5y agoProbably 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.
- LanternLight83 5y agoJust 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.
- IgorPartola 5y agoThat is the opposite of what most people will say. To most, reading someone else’s code is much harder than constructing their own. Try this one: @P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{ @p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord ($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&& close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
- klyrs 5y agoSmartass 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
- sellyme 5y agoThe same way I verify that my own regex is correct: by running a few test cases and then crossing my fingers.