Welcome To Snipplr


Everyone's Recent Regular Expression Snippets Tagged html5



« Prev 1 Next »
Use this to extract an HTML5 origin from a URI. $1 is the origin. The square brackets are there to support IPv6 addresses. Example: var html5OriginRegex = /^([\w-]+:\/*\[?[\w\.:-]+\]?(?::\d+)?).*/; "http://www.google.com:42/foo/bar/...
0 12 posted 11 years ago by Sephr
« Prev 1 Next »