You can use Find/Replace to do this. Open the Find dialog from the Search menu, 
check the "grep" box at the bottom which allows you to use regular expressions, 
and use these patterns to start. The first find https:// followed by the 
characters that are commonly found in URLs. The second replaces that with an 
anchor tag with the found text \0 used twice.

Find: https?://[a-zA-Z0-9/:\?&%=._\-+]+
Replace: <a href="\0" target="_blank">\0</a>

Find the first entry and if it needs replacing choose Replace and Find Next or 
simply Find Next if it doesn't need replacing. Or, if you don't have any links 
that are already formatted in the document you can do Replace All. I have key 
shortcuts assigned to these so I can quickly work through a document.

The Pattern Playground on the Search menu is useful for playing around with the 
find/replace patterns as well.

Hope this helps,

[fletcher]

> On Feb 4, 2021, at 11:24 AM, Martin <[email protected]> wrote:
> 
> Hi,
> this is my first post to this group. I hope I can express myself clearly ...
> 
> Can I use BBEdit to automatically convert lots of web addresses (e.g. 
> https://test.com) in an html document into hyperlinks? Perhaps by assigning a 
> <a> tag with "Search and replace" so that something like this arises: <a 
> href="https://test.com"; target="_blank"> https://test.com </ a >?
> 
> -- 
> This is the BBEdit Talk public discussion group. If you have a feature 
> request or need technical support, please email "[email protected]" 
> rather than posting here. Follow @bbedit on Twitter: 
> <https://twitter.com/bbedit <https://twitter.com/bbedit>>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/bbedit/5d8eea22-1b3c-49ca-8ced-202402d196ean%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/bbedit/5d8eea22-1b3c-49ca-8ced-202402d196ean%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "[email protected]" rather than 
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/634FF4B5-D771-4DEA-BA8A-3199528BB225%40cumuli.com.

Reply via email to