Replace email id by HTML Tag to make a hyperlink inside the text

Replace email id by HTML Tag to make a hyperlink inside the text

I have a text as follows

I have a text as follows

For further details, please contact [email protected]

I want to replace the email ID mentioned in the above text by <a href "[email protected]">[email protected]</a> So that the email ID would become a clickable object when the above text would be presented on web page

So far I have tried out following

text = 'For further details, please contact [email protected]'
email_pat = re.findall(r'[\w\.-][email protected][\w\.-]+\.\w+',text)
email_str = ' '.join(email_pat) #converts the list to string
text_rep = ext.replace(email_str,'<a href "email_str">email_str</a>')

The above code replace the email string but instead of creating hyperlink it actually does the following

For further details, please contact <a href "email_str">email_str</a>

Is there any way to tackle this?

python html regex

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Know Everything About HTML With HTML Experts

HTML Assignment Help Australia @30% OFF from Sample Assignment, with Our Best HTML assignment help experts. Get HTML homework help online at affordable price. 100% Plag free assignment solution.

Basic Data Types in Python | Python Web Development For Beginners

In the programming world, Data types play an important role. Each Variable is stored in different data types and responsible for various functions. Python had two different objects, and They are mutable and immutable objects.

Commonly Used HTML Tags with Examples

HTML tags are keywords used in HTML to display web-pages with certain properties. They are further used for defining HTML elements. An HTML element consists of a starting tag.

Hire Python Developers

Are you looking for experienced, reliable, and qualified Python developers? If yes, you have reached the right place. At **[]( "")**, our full-stack Python development services...

Python RegEx - Python Regular Expressions Tutorial

Python RegEx - Python Regular Expressions tutorial will help you in understanding how to use regular expressions in Python. You will get to learn different regular expression operations and syntaxes. You will be learning how to implement all the regex operations in python practically.