realbasic-nug
[Top] [All Lists]

Re: Validate URL

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Validate URL
From: Phil M <phil at mobleybros dot com>
Date: Thu, 31 Aug 2006 10:52:56 -0700
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <4D4FE5BC-9474-4F41-A279-8CCED96FB8B4 at jettfuel dot net> <60158160-593E-4BAD-A1EC-5DFE52EFA6C4 at mobleybros dot com> <20060831135833 dot 6546376C5A at isis dot visi dot com>
On Aug 31, 2006, at 6:58 AM, Craig A. Finseth wrote:

        ...
UBound(s) > 0. However, there can be exactly one "://" sequence for
   a valid URL, so you should reject it if it does not split into
        ...

Wrong.  There is no need for the "//":  the start of a URL is:

        <scheme>:<path>

<path> can start with any number of slashes: the specific syntax
depends on the scheme.  For example:

        mailto:abc at foo dot com

is legal, as is:

        file:///<path>

or even:

        http:abc/def

In this case, it's a relative URL and you can't resolve it without
knowing the base URL.  However, it is still a valid URL.

You are correct in all of these points. My function would fail on "mailto" and "file" (I thought about that one after I sent the message), and does not work at all for relative URLs.


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>