←back to thread

Regex Isn't Hard (2023)

(timkellogg.me)
75 points asicsp | 6 comments | | HN request time: 0.967s | source | bottom
1. poisonborz ◴[] No.43750481[source]
This is truly one thing AI solved. Hard to write, easy to test. No one needs to learn this convoluted syntax in the future and we're all better for it.
replies(3): >>43750537 #>>43750588 #>>43750794 #
2. mrkeen ◴[] No.43750537[source]
Nothing that LLMs produce today is good enough to bypass a developer who can judge whether it's correct or not.
3. ykonstant ◴[] No.43750588[source]
I wonder if the problems people are pointing out with the examples (lowercase not being correct under various locales, IP address regex not being conformant etc) would be absent in code furnished by LLMs.
4. bazoom42 ◴[] No.43750794[source]
How would you know if a regex is correct if you dont understand it?
replies(1): >>43752218 #
5. poisonborz ◴[] No.43752218[source]
You have test strings covering all cases and they match accordingly? The same way you'd know when writing manually.
replies(1): >>43753334 #
6. bazoom42 ◴[] No.43753334{3}[source]
Covering all cases? How would that be possible? Even if we only consider ASCII strings, there are 16.000 possible two-character strings, 2 million possible three-character strings and so on.