ME:: tl;dr-ing: pick from or edit LLM generated regexes or add your own and see relevant examples in VSCode, seems like a practical and safe use of LLMs; Siddhartha Prasad:: LLMs ⭢ Regular Expressions, Responsibly!
Discovered: Dec 17, 2025 17:51 (UTC) ME:: tl;dr-ing: pick from or edit LLM generated regexes or add your own and see relevant examples in VSCode, seems like a practical and safe use of LLMs; Siddhartha Prasad:: LLMs ⭢ Regular Expressions, Responsibly!
QUOTE
- Read the whole thing: Siddhartha Prasad:: LLMs ⭢ Regular Expressions, Responsibly!]
But we can do a lot better! Our new tool, PICK:Regex, does the following. It asks you for a prompt and sends it to a GenAI system. However, it doesn’t ask for one regex; instead, it uses an LLMs ability to interpret prose in multiple ways to generate multiple (about four) candidate expressions. (The details don’t matter, but if you want to you can open the images below in a new tab to read them more easily.)
In theory, that’s better than getting just one interpretation. But now you may have to read four regexes like the above, which is actually worse! Therefore, instead, PICK shows you concrete examples. Furthermore, the examples are carefully chosen to tell apart the regexes. You are then asked to upvote/downvote each example. As you do, you are actually voting on all the candidate regexes.
You can stop at any point (you’re always shown the regexes), but the process naturally halts when only one regex remains (this is your best candidate of the ones you’ve seen so far) or none remain (in which case it would have been dangerous to use the LLMs output!).