Skip to content

Commit

Permalink
Add _ as a permitted parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
hiuxmaycry committed Apr 3, 2023
1 parent 405254c commit d53d831
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion main.js
Expand Up @@ -19,7 +19,7 @@ module.exports = function (RE) {
var auth = '(?:\\S+(?::\\S*)?@)?';
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
5 changes: 3 additions & 2 deletions package.json
@@ -1,11 +1,12 @@
{
"name": "urlregex",
"version": "0.6.1",
"version": "0.6.2",
"description": "URL validation for Node and the browser",
"main": "server.js",
"browser": "browser.js",
"scripts": {
"test": "tap test/*.js"
"test": "tap test/*.js",
"tdd": "tap -w --no-coverage-report test/*.js"
},
"keywords": [
"url",
Expand Down
2 changes: 0 additions & 2 deletions test/notmatch.js
Expand Up @@ -33,8 +33,6 @@ const defaultOptsFixture = [
'http://go/ogle.com',
'https://_dev.envfoo',
'https://dev.envfoo_',
'https://dev.envfoo_.bar',
'https://dev._envfoo.bar',
'https://dev.envfoo.bar_',
'http://foo.bar/ /',
'http://google\\.com',
Expand Down
2 changes: 2 additions & 0 deletions test/urlmatch.js
Expand Up @@ -60,6 +60,8 @@ const exactFixtures = [
'www.google.com/unicorn',
'https://dev_env.foo.bar',
'https://dev.env_foo.bar',
'https://dev.envfoo_.bar',
'https://dev._envfoo.bar',
'http://example.com.',
'http://www.microsoft.xn--comindex-g03d.html.irongeek.com',
'www.microsoft.xn--comindex-g03d.html.irongeek.com',
Expand Down

0 comments on commit d53d831

Please sign in to comment.