I am trying to improve upon the LaTeX brush used by Alex Gorbatchev’s SyntaxHighlighter. The brush I found online correctly matches LaTeX comments, which start with %, but gets it wrong when it is escaped \%; i.e., it thinks the latter is also a comment.
The RegExp used in the brush is %.*. I figured that a negative lookbehind (?<!\\)%.* would work, but JavaScript doesn’t support this… Any other ideas?
Thanks 🙂
i guess you could use this
([^\\]|^)%.*saying either its not \ or it is start of line