JSFiddle - React, Tailwind, and code Playground

JavaScript

var string = "$b$o$F33H$F32a$F31v$F30n";

console.log(string.replace(/\$(\\(\$)|[0-9a-f]{2,3}|[lh]\[.*?\]|.)/gi, ''))