realbasic-nug
[Top] [All Lists]

Re: RegEx question

To: "REALbasic NUG" <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: RegEx question
From: "Adam Shirey" <adam dot shirey at gmail dot com>
Date: Fri, 31 Aug 2007 09:48:45 -0500
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <46D74652 dot 4070705 at stny dot rr dot com> <10AB228E-EC8D-4715-A717-38A70184D08D at seedit dot info> <46D755E6 dot 4020203 at stny dot rr dot com> <E2AA9F8A-E1B8-43BE-99AB-7EA9DA96CEFA at seedit dot info> <46D758BE dot 5060002 at stny dot rr dot com> <54CB1CA0-989D-4124-AE4C-3A5112193AAF at seedit dot info> <E65110CC-6B4F-4258-91FE-EA90783C3EF4 at seedit dot info> <65915B83-2897-4356-A390-0DEB52AA2513 at seedit dot info> <1F45B8DF-972C-4B2C-81A6-E5636A5F662D at seedit dot info> <46D7685F dot 8080707 at stny dot rr dot com>
Completely untested, shoot-from-the-hip code:

re.SearchPattern = "<a[^>]+?href=(['""]?)([^""']+)\1"
re.ReplacementPattern = "$2"

That *should* be a little more resilient to issues of other tags (eg,
<link href...>) as well as different or no quotes ("http://..";,
'http://...', http://...).



-Adam
dingostick.com






On 8/30/07, Tom Russell <linuxrox at stny dot rr dot com> wrote:
> Sven E Olsson wrote:
> > There is more problems, if don't wanted links like this:
> > <link rel="alternate" type="application/rss+xml" title="SEEdit Maxi
> > RSS News" href="http://www.seedit.info/rss/rss.xml"; />
> > And links to css files could also use http://www. if the css file is
> > on another server.
> >
> > Sven E
> > -----------------------
> > REALbasic 2007R3 OS X 10.4.10 Intel and 10.3.9/10.4.10 PPC
> > SEEdit Maxi THE XHTML EDITOR FOR MACINTOSH
> > http://www.seedit.info
> >
> >
> >
> > _______________________________________________
> > Unsubscribe or switch delivery mode:
> > <http://www.realsoftware.com/support/listmanager/>
> >
> > Search the archives:
> > <http://support.realsoftware.com/listarchives/lists.html>
> >
> >
> >
> Thanks.
>
> At least I can tweak it out.
>
> Appreciate the help.
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>
>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


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