A handful of patterns cover most everyday validation needs: ^[\w.-]+@[\w.-]+\.\w+$ for a loose email check, ^\d{3}-\d{3}-\d{4}$ for a US phone number, and ^https?:\/\/ to detect a URL scheme.

Test any of these directly in our Regex Tester before dropping them into your code.

Share this article: Twitter LinkedIn Email

Looking for a tool to try out what you just read? Browse the full tools catalog.