RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Advanced Search

Keywords

Category

Minimum Rating

Results per Page

Search Results: 6 regular expressions found.

   Displaying page 1 of 1 pages; Items 1 to 6
Title Test Details Pattern Title
Expression
^((ht|f)tp(s?))\://([0-9a-zA-Z\-]+\.)+[a-zA-Z]{2,6}(\:[0-9]+)?(/\S*)?$
Description
Simple URL Validator -- allows http, https, ftp, ftps, 2-6 letter TLD, ports, any path. Sorry, no IP addresses. Not too fussy, but then, it's not too long either ;-)
Matches
http://www.site.com | https://www.secure.com:10000 | ftp://ftp.site.com/pub/files/
Non-Matches
www.site.com | https://www.site.longtld | ftp:/badformat.com
Author Rating: The rating for this expression. Luke Arms
Title Test Details URL Validator
Expression
^(http(?:s)?\:\/\/[a-zA-Z0-9]+(?:(?:\.|\-)[a-zA-Z0-9]+)+(?:\:\d+)?(?:\/[\w\-]+)*(?:\/?|\/\w+\.[a-zA-Z]{2,4}(?:\?[\w]+\=[\w\-]+)?)?(?:\&[\w]+\=[\w\-]+)*)$
Description
A simple but powerful URL validating regex. Accepts multiple sub-domains and sub-directories. Even accept query strings. Now accept ports! Accepts HTTP or HTTPS. Also accepts optional "/" on end of address.
Matches
http://website.com | http://subdomain.web-site.com/cgi-bin/perl.cgi?key1=value1&key2=value2
Non-Matches
http://website.com/perl.cgi?key= | http://web-site.com/cgi-bin/perl.cgi?key1=value1&key2
Author Rating: The rating for this expression. tedcambron
Title Test Details HTTP(S) URL
Expression
https?://[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*(?:\.[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)*/\S*
Description
HTTP(S) URL validator with embededded multi-part host name validator, RFC-compliant but does not validate length of components or overall length. Path portion after host name is free-form and will need refinement if you want to validate it.
Matches
http://www.example.com/ https://localhost/whatever
Non-Matches
http://www.example.com ftp://localhost/whatever
Author Rating: Not yet rated. Kevin Dean
Title Test Details URL Validator
Expression
/^(https?|ftp)(:\/\/)(([\w]{3,}\.[\w]+\.[\w]{2,6})|([\d]{3}\.[\d]{1,3}\.[\d]{3}\.[\d]{1,3}))(\:[0,9]+)*(\/?$|((\/[\w\W]+)+\.[\w]{3,4})?$)/
Description
This expression will test against most URLs and return whether they are valid URL's or not. It will allow some false positives in that it is only checking for the correct character count, but this could be enhanced by adjusting it to check for specific TLDs or file extensions.
Matches
http://www.website.com, http://subdomain.website.com, https://www.website.net/subfolder/subfolder/file.htm, http://www.website.org/subfolder/subfolder/file_weird%[email protected]#.pdf, https://209.165.5.487/about.html
Non-Matches
http://www.missingperiodcom, http:/misssingforwardslash.com, http://www.missingTLD., www.missingHTTP.com
Author Rating: Not yet rated. Harry
Title Test Details URL Validator
Expression
^(?:http|https):\/\/[\w.\-]+(?:\.[\w\-]+)+[\w\-.,@?^=%&:;/~\\+#]+$
Description
Broad URL Validator
Matches
http://calendar.creighton.edu/ http://woork.blogspot.com/2009/01/elegant-animated-weekly-timeline-for.html http://flesler.blogspot.com/
Non-Matches
http://.com/
Author Rating: Not yet rated. Damien Dates
Title Test Details The Most Complete URI & URL validator, for absolute & relative URLs
Expression
^((http(s){0,1}\:\/\/){0,1}([a-z|A-Z|0-9|\.|\-|_]){4,255}(\:\d{1,5}){0,1}){0,1}((\/([a-z|A-Z|0-9|\.|\-|_]|\%[A-F|a-f|0-9]{2}){1,255}){1,255}\/{0,1}){0,1}(|\/{0,1}\?[a-z|A-Z|0-9|\.|\-|_]{1,255}\=([a-z|A-Z|0-9|\.|\-|_|\+|\:]|\%[A-F|a-f|0-9]{2}|\&[a-z|A-Z]{2,12}\;){0,255}){0,1}((\&[a-z|A-Z|0-9|\.|\-|_]{1,255}\=([a-z|A-Z|0-9|\.|\-|_|\+|\:]|\%[A-F|a-f|0-9]{2}|\&[a-z|A-Z]{2,12}\;){0,255}){0,255})(\/{0,1}|\#([a-z|A-Z|0-9|\.|\-|_|\+|\:]|\%[A-F|a-f|0-9]{2}|\&[a-z|A-Z]{2,12}\;){0,255})$
Description
Validates completely for relative and absolute paths, and allows port definitions. Also contains parameter validation, and allows for anchors and URL escape characters.
Matches
http://www.google.com | https://sub.domain.com:8080/ok | mobi.yoursite.org/%e3498549843 | /relative_path/ok/home.aspx?id=4985&x=5
Non-Matches
http://site.com/?id=4095?x=485 | http://site.com:3098594 | www.site.org?p=this is wrong
Author Rating: The rating for this expression. Stuart Steedman
   Displaying page 1 of 1 pages; Items 1 to 6

Copyright © 2001-2021, RegexAdvice.com | ASP.NET Tutorials