extended % matching for HTML, LaTeX, and many other languages