Regex to convert URLs to HTML <a href> hyperlinks in Notepad++?

notepad++, regex

Solution

Use the regex

`(http://mydomain.com/(.*?)\.html)`

and replace it with

`<a href="\1">\2</a>`

If you want to change `-` into `space` you can do this

`-(?=[^<>]*?</a>)`

and replace it with

``

Problem

I have a list of URLs in a text file I am trying to change to HTML, but I'm failing miserably. My URLs are in this format: ``` http://mydomain.com/here-are-my-links.html ``` Does anybody know of a regex search/replace command I can run in Notepad++ to change my URL list to this format: ``` <a href="http://mydomain.com/here-are-my-links.html">here are my links</a> ```

Original source