Search and replace square brackets (parsing RSS-feed)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Search and replace square brackets (parsing RSS-feed)

CoMedia
I'm facing a problem with parsing a RSS-feed from VersionTracker.com:

http://newsfeed.versiontracker.com/f/versiontracker_macintel

The <title> tag is using square brackets inside, like:

<title><![CDATA[CaminoKnight - 3.0]]></title>

The output I want is simply:

<title>CaminoKnight - 3.0</title>

I have been trying all kinds of combinations, like

[String_ReplaceRegExp: $item->(Find: 'title')), -Find='<![CDATA[|]]
 >', -Replace='']
[String_ReplaceRegExp: $item->(Find: 'title')), -Find='\\<\\!\\[CDATA\
\[|\\]\\]\\>', -Replace='']
[String_ReplaceRegExp: $item->(Find: 'title')), -Find='<!([CDATA[)|
(]])>', -Replace='']
[String_ReplaceRegExp: $item->(Find: 'title')), -Find='(<![CDATA[)|(]]
 >)', -Replace='']

but nothing seems to do the job.

The RegularExpressionExplorer utility (http://support.blueworld.com/ 
article_files/RegularExpressionExplorer.lasso) isn't helpful either,  
it only gives me a '-9956 No table name was provided' error. It seems  
it doesn't like square brackets either.

So my question is: how to search and replace square brackets in a  
string?

I think the solution might be in this thread

http://www.listsearch.com/lassotalk.lasso?id=121788

(make it a variable), but I'm not sure how to implement it...

Kind regards,


CoMedia,
Alfred Konijnenbelt


________________________________________________________________________
____

CoMedia [web & data concepts]            Bakemastraat 2, 3822 WJ  
Amersfoort
[i] http://www.comedia.nl                                [e]  
[hidden email]
[t] +31 (0)33 455 84 26   [f] +31 (0)33 455 09 38    [m] +31 (0)628  
82 01 22




============================================
Attend the Lasso Summit
February 17-19, 2006 in Fort Lauderdale, FL
http://www.LassoSummit.com/
============================================

--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Search and replace square brackets (parsing RSS-feed)

Marc Vos-3
Are you sure that $item->(find: 'title') returns what you expect?

-Marc Vos
* * * * * * * * * * * * * * * * * * * * * * * *
Goodyear Dunlop Tires Germany GmbH
Private:  http://marc.vos.net/
* * * * * * * * * * * * * * * * * * * * * * * *

On 27-jan-2006, at 14:20, CoMedia web & data concepts wrote:

> I'm facing a problem with parsing a RSS-feed from VersionTracker.com:
>
> http://newsfeed.versiontracker.com/f/versiontracker_macintel
>
> The <title> tag is using square brackets inside, like:
>
> <title><![CDATA[CaminoKnight - 3.0]]></title>
>
> The output I want is simply:
>
> <title>CaminoKnight - 3.0</title>
>
> I have been trying all kinds of combinations, like
>
> [String_ReplaceRegExp: $item->(Find: 'title')), -Find='<![CDATA[|]]
> >', -Replace='']
> [String_ReplaceRegExp: $item->(Find: 'title')), -Find='\\<\\!\\
> [CDATA\\[|\\]\\]\\>', -Replace='']
> [String_ReplaceRegExp: $item->(Find: 'title')), -Find='<!([CDATA[)|
> (]])>', -Replace='']
> [String_ReplaceRegExp: $item->(Find: 'title')), -Find='(<![CDATA[)|
> (]]>)', -Replace='']
>
> but nothing seems to do the job.
>
> The RegularExpressionExplorer utility (http://support.blueworld.com/ 
> article_files/RegularExpressionExplorer.lasso) isn't helpful  
> either, it only gives me a '-9956 No table name was provided'  
> error. It seems it doesn't like square brackets either.
>
> So my question is: how to search and replace square brackets in a  
> string?
>
> I think the solution might be in this thread
>
> http://www.listsearch.com/lassotalk.lasso?id=121788
>
> (make it a variable), but I'm not sure how to implement it...
>
> Kind regards,
>
>
> CoMedia,
> Alfred Konijnenbelt
>
>
> ______________________________________________________________________
> ______
>
> CoMedia [web & data concepts]            Bakemastraat 2, 3822 WJ  
> Amersfoort
> [i] http://www.comedia.nl                                [e]  
> [hidden email]
> [t] +31 (0)33 455 84 26   [f] +31 (0)33 455 09 38    [m] +31 (0)628  
> 82 01 22
>
>
>
>
> ============================================
> Attend the Lasso SummitFebruary 17-19, 2006 in Fort Lauderdale, FL
> http://www.LassoSummit.com/
> ============================================
>
> --
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription: http://www.listsearch.com/ 
> lassotalk.lasso?manage


============================================
Attend the Lasso Summit
February 17-19, 2006 in Fort Lauderdale, FL
http://www.LassoSummit.com/
============================================

--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Search and replace square brackets (parsing RSS-feed)

Fletcher Sandbeck
In reply to this post by CoMedia
On 1/27/06 at 2:20 PM by [hidden email] (CoMedia web & data concepts):

>I'm facing a problem with parsing a RSS-feed from VersionTracker.com:
>
>http://newsfeed.versiontracker.com/f/versiontracker_macintel
>
>The <title> tag is using square brackets inside, like:
>
><title><![CDATA[CaminoKnight - 3.0]]></title>
>
>The output I want is simply:
>
><title>CaminoKnight - 3.0</title>

If you use the [XML] type to parse the RSS feed then Lasso will clean up the CDATA markup for you.

var: 'xml' = (xml: '<title><![CDATA[CaminoKnight - 3.0]]></title>');
$xml->contents;

[fletcher]
--
Fletcher Sandbeck                         [hidden email]
Director of Product Development       http://www.lassostudio.com
OmniPilot Software, Inc.                http://www.omnipilot.com

============================================
Attend the Lasso Summit
February 17-19, 2006 in Fort Lauderdale, FL
http://www.LassoSummit.com/
============================================

--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage