Skip to content

Commit

Permalink
Accepts undercores in URL regex (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
hiuxmaycry committed Mar 22, 2023
1 parent 099d82f commit 3f6e8e5
Show file tree
Hide file tree
Showing 5 changed files with 3,232 additions and 2,819 deletions.
4 changes: 2 additions & 2 deletions main.js
Expand Up @@ -17,9 +17,9 @@ module.exports = function (RE) {
'(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])){3}';
var protocol = allowedProtocols === '*' ? '(?:(?:[a-z]+:)?//)?' : '(?:('+ allowedProtocols.join('|') +')://)?';
var auth = '(?:\\S+(?::\\S*)?@)?';
var host = '(?:(?:[a-z\\u00a1-\\uffff0-9_]-*)*[a-z\\u00a1-\\uffff0-9]+)';
var host = '(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)';
var domain =
'(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*';
'(?:\\.(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)*';
var tld = tldvalidation ? '(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))\\.?' : '';
var port = '(?::\\d{2,5})?';
var path = '(?:[/?#][^\\s"]*)?';
Expand Down

0 comments on commit 3f6e8e5

Please sign in to comment.