I want to replace the text inside the brackets and has colonand u.
For example, it Here is a link [u:person]!will become Here is a link <a href="/user/person">Person</a>!I am not very good at regular expression, and I am having problems with \1and$1
Here is the regex that I'm using now:
string.gsub(/\[(\w*).*?\]/, "<a href='/user/\1'>\1</a>")
source
share