|
|
|
|
|
by memorable
1438 days ago
|
|
I have played with this for a while, and here are some prompts that might be interesting. Prompt: "URL regex" ^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$
Prompt: "Email regex" /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))
This one's weirdly sophisticated for some reason.Prompt: "An HTML tag with a close tag and attributes" <([a-zA-Z]+)[^>]*?(?<!\/)>.*?<\/\1>
|
|
I'd wager that one probably misses a bunch of corner cases.
[0] https://www.regular-expressions.info/email.html