How do I pick up the last occurrance of a matching string by regular expression. For example: I have string:
<a href=url1><a href=url2>......<end>
I want to pick up the last url before "<end>"
I use regular expression pattern: "<a href=(.+?)><end>" and it gives me "url1><a href=url2>......".