Thread: Rss2Book
View Single Post
Old 09-23-2007, 02:39 PM   #223
dietric
Junior Member
dietric began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Aug 2007
Device: Sony Reader
Help with regular expression

I'm trying to create a Web2Book feed for
http://www.spiegel.de/schlagzeilen/rss/0,5291,,00.xml

I would like to rewrite the links to link to the printable version, but the pattern to replace the link is somewhat complex:
The link in the feed looks like this:
http://www.spiegel.de/politik/auslan...506744,00.html
The printable version like this:
http://www.spiegel.de/politik/auslan...506744,00.html

From what I can see by examining other links the constants are:
- http://www.spiegel.de/ (obviously)
- one or more folder names
- the actual file name consists of three numbers separated by comma
- in the printable version, the string "druck-" is added before the third number
- the extension is .html

I'm not so good with RegEx, help would be appreciated.
dietric is offline   Reply With Quote