Last active
November 23, 2023 14:38
-
-
Save victory-sokolov/956b884688428afe2b825c36c7367e22 to your computer and use it in GitHub Desktop.
JS Regex Patterns
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
/* Common Regular Expressions */ | |
// Match domain (com,net,ru) | |
let url = "https://www.youtube.com/watch?v=vEPOU_fKmR8"; | |
url.match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i); | |
let site = matches && matches[1]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment