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 13:19:54 -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=m4gESws9FY6iHDrvcmt1MNiSkD6LeSW1LIDRsmbZfkd0i9PyLonv8NCfQ8jgwZ85ZP1m7tL3nbu9htokR1Q35Kz6MNiMZNL0i+qMvqUekdxket2ejdIUQPy2POcBGZvQwK+HUSlnbJuPQSML7lokFHerUeVEQb1KGqDKZoCA0cI=
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> <7A504711-7D58-43CE-A098-5F25E8801699 at mobleybros dot com> <C720ACBE-0A2B-45EF-A279-94FD5422165B at great-white-software dot com> <fed2e2560608311137k3fe1d7fay7ee9a1357f4ae4aa at mail dot gmail dot com> <BDD05AF6-EC8C-40EF-8EFA-7C1E0F92278C at great-white-software dot com>
Well then I'm still lost as far as how to use the provided Regex
string to validate a URL in RB. I tested with a string that was only
one of several variations of malformed URLs (as well as a valid URL),
and it validated each of them.

On 8/31/06, Norman Palardy <npalardy at great-white-software dot com> wrote:

On Aug 31, 2006, at 12:37 PM, Dennis Birch wrote:

> What do you mean by "anchored to the beginning and end"?

The ^ in a regex says that the pattern has to start at the beginning
of the line and $ at the end of the regex says it has to end at the
end of the line.
(I may have this backwards)

If you change the regex to have those two characters (at the
beginning and end) and then have it check the URL it should avoid
finding a valid URL anywhere in any text

The other way be to simply see that the pattern found is the same
length as the original string

if it's not what you have found is a substring inside some other text
_______________________________________________
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>