KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am looking to write something that seems like it should be easy enough, but for whatever reason I'm having a tough time getting my head around it. I am looking to write a python function that, when passed a string, will pass that string back with HTML encoding around URLs. unencoded_string = "This is a link - http://google.com" def encode_string_with_links(unencoded_string): # some sort of regex magic occurs return encoded_string print encoded_string 'This is a link - <a href="http://google.com">http://google.com</a>' Thank you!
Tags (comma-separated)
Save Edits
Cancel