| View previous topic :: View next topic |
| Author |
Message |
Jagg Halfop
Joined: 24 Jan 2004 Posts: 53
|
Posted: Wed May 23, 2012 9:55 am Post subject: small regexp to convert a url |
|
|
Hi,
which regexp do I need to regexp a url like
| Code: | | 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
| Code: | | www.ftd.de/article/70040990.html |
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 |
|
| Back to top |
|
 |
doggo Halfop
Joined: 05 Jan 2010 Posts: 97
|
Posted: Wed May 23, 2012 11:37 am Post subject: |
|
|
summit like this? untested but should do the job
| Code: |
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"
|
_________________ NON geeky!! http://gotcode4u.com/ |
|
| Back to top |
|
 |
Jagg Halfop
Joined: 24 Jan 2004 Posts: 53
|
Posted: Thu May 24, 2012 8:05 am Post subject: |
|
|
| Thanks |
|
| Back to top |
|
 |
|