Menu

Post image 1
Post image 2
1 / 2
0

Stop Testing Regex in Your Browser Console Use This Free Tool Instead

DEV Community: webdev·Muhammad Awais·about 14 hours ago
#Ffzs97n5
#dev#fullscreen#match#test#regex#article
Reading 0:00
15s threshold

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 ( " user@example.com " ) Enter fullscreen mode Exit fullscreen mode It returns true . Great. But does it handle edge cases? What about user+tag@sub.domain.co.uk ? 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. You see immediately if you're matching too much or too little, without running console.log a dozen times.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More