MyCode Replacement for [url][/url]
#1
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 ?
-
Reply
#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?
MyBB Translator & helper
Please do not PM me requesting free support or help for your forums.
You can see my paid services here.
Reply
#3
(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
-
Reply
#4
Sorry, I don't understand, what do you need css for?...
MyBB Translator & helper
Please do not PM me requesting free support or help for your forums.
You can see my paid services here.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)