realbasic-nug
[Top] [All Lists]

Re: Re: Validate URL

To: "REALbasic NUG" <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Re: Validate URL
From: "Dennis Birch" <dennisbirch at gmail dot com>
Date: Thu, 31 Aug 2006 11:03:36 -0700
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=YK2hP4xVZoRz5kYiKSPtXe6cqC8gTVzsiL6/ZLrvqURAxfHuVohlmL8p6t48UbJINLo8+9LloYnfx4vR3Ifpapc2zdf2prx+nfT7mOt5QIq0NyEvvP2KMJgW8T01fRylx0Xw6VdwPcTDkWWtR7wAXC+DE+b/JgrlccPkkdhOoKc=
References: <4D4FE5BC-9474-4F41-A279-8CCED96FB8B4 at jettfuel dot net> <020c01c6cca3$5dd7ff10$6401a8c0 at HP> <fed2e2560608311021x3edb7493m9d6511a09b1b348d at mail dot gmail dot com> <22BC1D60-43FC-4A72-8610-6E71AE909944 at declareSub dot com>
Your code is very similar to what I tried. I found it (and your
variation) returns valid results for totally invalid URLs.

On 8/31/06, Charles Yeomans <charles at declaresub dot com> wrote:
   dim r as new RegEx
   r.SearchPattern = "(([a-zA-Z][0-9a-zA-Z+\\-\\.]*:)?/{0,2}[0-9a-zA-
Z;/?:@&=+$\\.\\-_!~*'()%]+)?(#[0-9a-zA-Z;/?:@&=+$\\.\\-_!~*'()%]+)?"

   dim match as RegExMatch = r.Search(EditField1.Text)
   if match <> nil then
     MsgBox "Validated: " + match.SubExpressionString(0)
   else
     MsgBox "Failed."
   end if

But it's not clear to me that this regular expression does quite what
one expects.
_______________________________________________
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>