Replace www.example.com w/ <a href=“http://www.example.com”>www.example.com</a>
问题 I am not very good at regex, but I need to convert the following example from this <li>Creations by Carol - www.driedfloralcreations.com</li> to <li>Creations by Carol - <a href="http://www.driedfloralcreations.com" rel="external">www.driedfloralcreations.com</a></li> 回答1: If you're only looking for URLs in <li> elements formatted like the one in your question, it should be much simpler than a lot of the other suggested solutions. You don't really need to validate your URLs, I assume, you