Skip to content
This repository has been archived by the owner on May 7, 2019. It is now read-only.

jhermsmeier/uri.regex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URI Regular Expression Build Status

I found a perfectly working regular expression on jmrware.com, stole it and added capture groups for the various parts. All credit for that regex goes to Jeff Roberson.

Example Usage of uri.js

var URI = require( './uri.js' )
var input = 'http://user:password@example.com:8080/some/path/to/somewhere?search=regex&order=desc#fragment'

var uri = new URI( input ) // =>
{
  protocol:  'http',                      // match[1]
  slashes:   '//',                        // match[2]
  authority: 'user:password',             // match[3]
  host:      'example.com',               // match[4]
  port:      '8080',                      // match[5]
  path:      '/some/path/to/somewhere',   // match[6] || match[7] || match[8]
  query:     'search=regex&order=desc',   // match[9]
  hash:      'fragment'                   // match[10]
}

About

URI Regular Expression

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published