Reputation:
I have a forum on which users can use the CKEditor to make links. However, some users just post the raw url, resulting in some links nice formatted and some links not.
I'd like to make a filter based on a regex to make links of the raw urls. However, I'm stuck at making the regex. Requirements:
<b>
, <p>
, blockquote
, ...)<a>
tag<a href="http://...">
)What regex can I use?
Upvotes: 1
Views: 56
Reputation: 16553
This technique is called linkification. It's to complex to do with just a regular expression. Luckily there good libraries for most languages.
Upvotes: 4