MyBB Community Forums

Full Version: New MyCode such as [url] but with attribute a rel=noffolow
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi.

I wanted to create a new MyCode or modify the [url] so that you can add the attribute rel = follow or rel = noffolow. I tried:

[a href=(.*?) title=(.*?) rel=(.*?)](.*?)[/a]

<a href="$1" title="$2" rel="$3">$3</a>

but it does not work. Do you have any other ideas?
Your replacement code is trying to use the third variable twice and ignore the fourth entirely. The replacement should be:
<a href=$1 title=$2 rel=$3>$4</a>

You could probably include the quotes around the items (ie href="$1" instead of href=$1) if you wanted, though I have never actually done this.
Thank, I made a mistake with this variable but improving, unfortunately still not working. : (
Your regular expression code (shown here anyway) is also missing the backslashes before the brackets.

Should be:
\[a href=(.*?) title=(.*?) rel=(.*?)\](.*?)\[/a\]

with a replacement of:
<a href=$1 title=$2 rel=$3>$4</a>

Tested it on one of my forums and it worked.