Our great sponsors
-
RegExr
RegExr is a HTML/JS based tool for creating, testing, and learning about Regular Expressions.
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
libphonenumber
Google's common Java, C++ and JavaScript library for parsing, formatting, and validating international phone numbers.
I always include a link to the regexr.com near non-trivial regular expressions in my code. This makes way easier to understand and modify regexp later.
There's also a place to test your javascript, if you're interested.
The thing about the "simple" use cases like phone numbers is that they're often trickier than they seem (phone numbers from which country? With dashes or without? With country code or not?), so I'd probably just wind up reaching for something like libphonenumber.