Skip to content

Commit

Permalink
Merge pull request #1 from gamache/feature/underscores-in-hostnames
Browse files Browse the repository at this point in the history
allow underscores in hostname
  • Loading branch information
gamache committed Jun 28, 2016
2 parents 655ddef + 67665e0 commit 4629563
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/fuzzyurl/strings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Fuzzyurl::Strings
(?: : (?<password> \* | [a-zA-Z0-9%_.!~*'();&=+$,-]*))?
@
)?
(?<hostname> [a-zA-Z0-9\.\*\-]+?)?
(?<hostname> [a-zA-Z0-9\.\*\-_]+?)?
(?: : (?<port> \* | \d+))?
(?<path> / [^\?\#]*)? ## captures leading /
(?: \? (?<query> [^\#]*) )?
Expand Down
4 changes: 4 additions & 0 deletions test/matches.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
"example.com",
"example.com"
],
[
"ex_ample.com",
"ex_ample.com"
],
[
"example.com",
"example.com:80"
Expand Down

0 comments on commit 4629563

Please sign in to comment.