I have an url like this
<a href="https://www.mysite.com/blog/?attachment_id=638" rel="attachment wp-att-638">
How can i create a regular expression to match the url only and replace that? The regexp should only match where rel has the value attachment, like above.