Trying to strip the date from an article URL
I'm trying to create a recipe for a local newspaper. The article URL is formated like this:
The print version url is formated like this:
The problem I have is that this section of the article URL "-c-2011-02-15-" contains a date which changes so using url.replace does not seem to work. Is there a work around for this? I saw a couple of examples using spilt.url however I am new to this and I can't seem to get it to work.
I would also like to strip out all the characters after the article number ie: "-Former-official-to-receive-750-daily-for-interim-position-plus-pension-.html"
I would appreciate any help that you folks could give me.