3 ms·
What I do now is I write a comment like this in my IDE: # a regex that selects <something> regex = And then copilot/supermaven auto-completes it. If t
by extr 2y ago
What I do now is I write a comment like this in my IDE:
# a regex that selects <something>
regex =
And then copilot/supermaven auto-completes it. If that doesn't work, I ask GPT-4o/Sonnet. If that doesn't work, I assume that whatever I'm asking for is not really a natural fit for regex and I should accomplish my task in a different way.
In general I try not to use regex in production code. IMO it is an obsolete technology at this point. Most people do not know it well and trying to debug it is a nightmare. May I suggest a simple function or loop that is readable?