Welcome To Snipplr
Everyone's Recent Regular Expression Snippets Tagged url
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
« Prev 1 Next »
thanks to...
http://gskinner.com/RegExr/
http://daringfireball.net/2010/07/improved_regex_for_matching_urls
1
2040
posted 11 years ago by brandonjp
PCRE that matches any kind of YouTube URL and catches its video ID. It supports three kinds of URL: the classic (?v=), the AJAXed one (#!v=) and the short version (youtu.be). It also supports international URLs.
Tested with Javascript and PHP.
1
1348
posted 13 years ago by nkm
Matches are as follows:
0 = protocol
1 = fqdn
2 = subdomain
3 = top level subdomain
4 = domain (blah.com)
5 = port
6 = path
7 = query string
8 = hash
1
618
posted 14 years ago by remotezygote
« Prev 1 Next »