Every developer has done this at least once.
You need a regex pattern. You open the browser console, type something like:
/^ [ \ w . - ] + @[ \ w . - ] + \ . \ w { 2 ,} $ / . test ( " [email protected] " )
Enter fullscreen mode
Exit fullscreen mode
It returns true . Great. But does it handle edge cases? What about [email protected] ? What about an empty string? What about unicode characters in the local part?
So you modify the pattern. Test again. Modify. Test. Realize you don't actually understand why the {2,} is there. Open a Stack Overflow tab. Lose 40 minutes.
There's a better way.
What I Actually Use Now
I built a free browser-based regex tester at WebToolsHub that handles the parts the browser console can't.
Here's what it does differently:
Live match highlighting as you type your pattern, every match in the test string gets highlighted in real time.…