This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Help for those learning Tcl or writing their own scripts.
Jagg
Halfop
Posts: 53 Joined: Sat Jan 24, 2004 11:32 am
Post
by Jagg » Wed May 23, 2012 9:55 am
Hi,
which regexp do I need to regexp a url like
Code: Select all
http://www.ftd.de/finanzen/maerkte/:zahlungsverzug-die-bonitaet-der-kunden-pruefen/70040990.html#utm_source=rss2&utm_medium=rss_feed&utm_campaign=/finanzen/maerkte
to
So
-
www.ftd.de is always the same
- look for int value followed by ".html" (here 70040990.html)
- the transform it to "
www.ftd.de/article/70040990.html "
Thanks
Last edited by
Jagg on Wed May 23, 2012 12:45 pm, edited 2 times in total.
doggo
Halfop
Posts: 97 Joined: Tue Jan 05, 2010 7:53 am
Contact:
Post
by doggo » Wed May 23, 2012 11:37 am
summit like this? untested but should do the job
Code: Select all
set url "http://www.url.de/finanzen/maerkte/:zahlungsverzug-die-bonitaet-der-kunden-pruefen/70040990.html#utm_source=rss2&utm_medium=rss_feed&utm_campaign=/finanzen/maerkte"
regexp {.*([0-9]+).html.*} $url match html_id
set new_url "http://www.url.de/article/$html_id.html"
Jagg
Halfop
Posts: 53 Joined: Sat Jan 24, 2004 11:32 am
Post
by Jagg » Thu May 24, 2012 8:05 am
Thanks