The regex should be using \\[ ... \\], or at least add an alternative for that. Also for the latex-inline. See this discussion on tex.stackexchange: [Why is \\[ … \\] preferable to $$ … $$?](https://tex.stackexchange.com/questions/503/why-is-preferable-to)