These days, I ask Claude/ChatGPT to create the regex and usually I know enough to be able to verify it. To double check, I'll start a new conversation and ask it what the regex does and verify it that way.
You can also ask it to create unit tests with edge cases. It might not catch every edge case, but usually it will create edge cases that you might not think of when writing unit tests yourself.
You can also ask it to create unit tests with edge cases. It might not catch every edge case, but usually it will create edge cases that you might not think of when writing unit tests yourself.