Not Solved [General] Custom MyCode Not Working
#1
Not Solved
I've added a MyCode to allow users to easily link to a profile by using a users UID.

It's not working. I've got no idea why, I've re-written it a multitude of times thinking maybe I screwed something up but still no success, any ideas?

REGULAR EXPRESSION
\[id=(.*?)\](.*?)\[/id\]

REPLACEMENT
<a href="/member.php?action=profile&uid=$1">$2</a> 

And  yes the code is enabled.
> SELECT finger FROM hand WHERE id='3'
Reply
#2
Not Solved
You were forgetting to escape a '/' since that is a special character in regex. Use this instead for your Regular Expression:
\[id=([0-9]+)](.*)\[\/id\]

This also ensures the id entered is an integer instead of allowing all characters. Have a nice day. Smile
Reply
#3
Not Solved
\[id=([0-9]+)](.*)\[\/id\]

Removes the option to use it like so:
[id=1]Administrator Account[/id]

I'm not sure what you have given me but it broke the replacement code.
<a href="/member.php?action=profile&uid=$1">$2</a> 

:/ Not sure, maybe it's just my end.
> SELECT finger FROM hand WHERE id='3'
Reply
#4
Not Solved
I forget to put a \ before a closing ].

\[id=([0-9]+)\](.*)\[\/id\]
Reply
#5
Not Solved
Thanks!!
> SELECT finger FROM hand WHERE id='3'
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)