I made a bbCode replacer and I got stucked with the linking.
$replacements[3] = '<a href="\1">\2</a>';
It replaces in no time, but with wrong URL… mydomain.com http:\\somelink.com\
What’s wrong with this one?
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.
You haven’t actually shown the regex to match it.. but it should be something like:
Find
Replace
Example
Output
Note
I purposely don’t validate the URL in the regex because it’s ugly and not necessary. Validate it using
filter_var(..., FILTER_VALIDATE_EMAIL);