Return to Snippet

Revision: 60843
at November 13, 2012 07:58 by brandonjp


Updated Code
(?:(?:http|https):\/\/)?([-a-zA-Z0-9.]{2,256}\.[a-z]{2,4})\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?

RegExp: /(?:(?:http|https):\/\/)?([-a-zA-Z0-9.]{2,256}\.[a-z]{2,4})\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?/gi
pattern: (?:(?:http|https):\/\/)?([-a-zA-Z0-9.]{2,256}\.[a-z]{2,4})\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?
flags: gi
1 capturing groups: 
   group 1: ([-a-zA-Z0-9.]{2,256}\.[a-z]{2,4})

Revision: 60842
at November 13, 2012 07:34 by brandonjp


Initial Code
/*  thanks to http://gskinner.com/RegExr/  */

(?:(?:http|https):\/\/)?([-a-zA-Z0-9.]{2,256}\.[a-z]{2,4})\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?

RegExp: /(?:(?:http|https):\/\/)?([-a-zA-Z0-9.]{2,256}\.[a-z]{2,4})\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?/gi
pattern: (?:(?:http|https):\/\/)?([-a-zA-Z0-9.]{2,256}\.[a-z]{2,4})\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?
flags: gi
1 capturing groups: 
   group 1: ([-a-zA-Z0-9.]{2,256}\.[a-z]{2,4})

Initial URL

                                

Initial Description
thanks to... 
http://gskinner.com/RegExr/
http://daringfireball.net/2010/07/improved_regex_for_matching_urls

Initial Title
Regular Expression for Matching URLs with or without http(s)

Initial Tags
regex, url, http, regexp

Initial Language
Regular Expression