Last active
August 13, 2018 17:55
-
-
Save wiltonbsilva/637220888326cbb9980e to your computer and use it in GitHub Desktop.
Regular Expression to match simple domain names
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RegEx: | |
^(\.?[a-z0-9]{3,9}(\.?[a-z]{2,3})*)$ | |
Test: | |
www.google.com | |
Test: | |
www.google.com.br | |
Test: | |
radio.uol.com.br | |
Test: | |
www.ec0.com.br |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hm, this is a little too simple, even for human errors: