in nodebb-plugin-dbsearch, query is $text - $search (not $regex).
I understand why.
this plugin shows you how to create new routes, and static templates. I should update this example to show how to utilize dynamic templates but it would be something along the lines of
(totally off the top of my head... but yeah when I get the time I'll update the plugin to do the above)