Page is a not externally linkable
- Code, Content, and Presentation
-- RSS, ATOM, and Related Technologies
---- Regex To Add And Delete Lines


doubleJ - 7:31 pm on Aug 8, 2011 (gmt 0)


Hello...
Is there a way, using a find/replace program and regular expressions, that I can turn this sample text...

<item>
<title>A Fighting Spirit - Pt. 01</title>
<subtitle>Fight The Good Fight Of Faith</subtitle>
<author>Keith Moore</author>
<itunes:author>Keith Moore</itunes:author>
<enclosure url="http://www.flcmedia.org/product/0302-AFightingSpirit-01-FightTheGoodFightOfFaith.mp3" length="" type="audio/mp3"/>
<pubDate>Tuesday, Sep 08, 1992 07:00</pubDate>
</item>

into this...

<item>
<title>01 - Fight The Good Fight Of Faith</title>
<dc:creator>Keith Moore</dc:creator>
<enclosure url="http://www.flcmedia.org/product/0302-AFightingSpirit-01-FightTheGoodFightOfFaith.mp3" length="23992870" type="audio/mpeg" />
<guid>http://www.flcmedia.org/product/0302-AFightingSpirit-01-FightTheGoodFightOfFaith.mp3</guid>
<pubDate>Tue, 08 Sep, 1992 19:00:00 CST</pubDate>
</item>

I'm not sure if regular expressions are powerful enough to change the date information, but I would assume that I can use the enclosure tag to create the guid (replace <enclosure url="*" length="" type="audio/mp3"/> with <enclosure url="*" length="" type="audio/mp3"/>{}e<guid>*</guid>).
Unfortunately, that isn't working. I've been reading about regex, but I'm just not getting it, for this purpose (replace this and this, but nothing between). Honestly, I haven't been getting a lot of it.
Hehehe...
I would also assume that you can delete any line that start with such and such, but I haven't figure that out, either.
Thanks for the help.
JJ


Thread source:: http://www.webmasterworld.com/rss_atom/4349152.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com