Hacker News new | ask | show | jobs
by xnorswap 12 days ago
I've been using regex decades, but it never really stuck to do anything too complex, it was the perfect intersection of difficult and infrequent. ( And also variable - PCRE vs others customisations / non-regular parts, etc ).

I am very glad that I can now just ask claude for a regex to achieve my intent.

Does it mean I'll never master regex? Yes it does, but decades has shown that was unlikely to ever happen anyway.

2 comments

How do you know that what it produces is correct?

I’m wondering if by the time you have been explicit enough in your prompt you might as well have looked up what you needed.

The expression is always terse so it’s not as if you are saving much typing.

Automation. And i think that vastly overestimating the time it takes to write explicit prompts.
Regex came up so infrequent that I found myself referring to documentation whenever I needed to use it. But I always wondered, what are the jobs or roles that use it so often that they have mastered it.
That's somewhat alien to me, I suppose because over the years I just never stopped using regex in search/replace tools, which is daily exposure regardless of what code needs to be written.

Sometimes the patterns are dirt-simple, like `/\bfoo/` to find things that start with foo, or a `/foo.?bar/i` to try to find multiple variations of FooBar and fooBar and foo-bar and FOO_BAR. Other contexts outside an IDE include browser dev-tools, exploratory SQL queries on the database, searching centralized logs, and occasionally turning lines of text into spreadsheets via CSV.

None of that guarantees deep expertise of the weirder tricks, but it absolutely keeps the general knowledge "warm."

anything with large amounts of user text input.