use custom regex for latex