You can. See MQTT 2.5 M1+ How to implement the equivalent to MQTT1 REGEX filters for an example using PaperUI. You will need to find someone else to help translate that to .things files.
Also, a JS transform is way overkill for this. Just use REGEX:\[(.*)\] (assuming there is no white space around it).