Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I have played with this for a while, and here are some prompts that might be interesting.

Prompt: "URL regex"

  ^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$
Prompt: "Email regex"

  /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))
This one's weirdly sophisticated for some reason.

Prompt: "An HTML tag with a close tag and attributes"

  <([a-zA-Z]+)[^>]*?(?<!\/)>.*?<\/\1>


Email addresses are notoriously hard to parse.[0]

I'd wager that one probably misses a bunch of corner cases.

[0] https://www.regular-expressions.info/email.html


This is all true, but suspect that the issue is mostly self-correcting since anything other than an extremely vanilla email address is likely to run into an infuriatingly high number of rejections precisely because the software at the other end has taken an overly simplistic view of what is allowed, forcing the owner to change it out of sheer frustration.


> Prompt: "An HTML tag with a close tag and attributes"

Obviously trained on a data set that didn't include <h1>

This whole thread is why I'm not scared of Copilot or similar taking away jobs anytime soon, since bug fixing is way harder than writing code




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: