Created
August 25, 2010 11:25
Revisions
-
sborsje created this gist
Aug 25, 2010 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ IPv4_PART = /\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]/ # 0-255 REGEXP = %r{ \A https?:// # http:// or https:// ([^\s:@]+:[^\s:@]*@)? # optional username:pw@ ( (xn--)?[^\W_]+([-.][^\W_]+)*\.[a-z]{2,6}\.? | # domain (including Punycode/IDN)... #{IPv4_PART}(\.#{IPv4_PART}){3} ) # or IPv4 (:\d{1,5})? # optional port ([/?]\S*)? # optional /whatever or ?whatever \Z }iux