MyBB Community Forums

Full Version: MyCode Replacement for [url][/url]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi
In mybb we post links in 2 way:
1-
[url=http://domain.com]link[/url]
2-
[url]http://domain.com[/url]



So if i need to use (Replacement & Regular Expression) for case 1 i can do this way:
\[url=(.*?)\](.*?)\[/url\]
<a href="$1">$2</a>


but in case 2 :
\[url\](.*?)\[/url\]
because of some long URLs... its not good to use this replacement:
<a href="$1">$1</a>


Is there a better replacement for case 2 ?
I don't really think that this 2nd case is necessary as you don't need url tag to paste url.

Just paste url like that. No need for tag.

Or you need something else?
(2017-12-08, 03:52 PM)Ikerepc Wrote: [ -> ]Just paste url like that. No need for tag.


\[url\](.*?)\[/url\]
Also support links without tag.


I think i have to use CSS
Sorry, I don't understand, what do you need css for?...