You may use $0 to insert the found text. For regular expressions, you may use $1 and so on to insert sub-matches. Regular expressions should also escape backslashes in the replacement content (using \\). You may use XenForo template syntax.