I'm porting a .asp application over to something else, and I need to re-write the following url pattern:<div><br></div><div><a href="http://www.example.com/posts/get_post.asp?post_id=123">www.example.com/posts/get_post.asp?post_id=123</a></div>

<div><br></div><div>to</div><div><br></div><div><a href="http://www.example.com/posts/123">www.example.com/posts/123</a></div><div><br></div><div>How can I do that?</div>