http://stackoverflow.com
should become
<a href="http://stackoverflow.com">http://stackoverflow.com</a>
EDIT: It would be great if anchor tags from the original string stayed intact.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
John Gruber just posted an interesting regex example to capture URLs:
Daring Fireball regex to get URLs
To cut to the chase, the (liberal, long) pattern he chose was:
That posits to capture all of the following:
So you’d use that pattern with something like preg_filter, and then iterate over the returned array of matches somehow. I guess. I hate regex.