Just a note that I'm (pretty) sure that highlighting cannot be accomplished
completely with regular expressions.

For complex situations, it needs to be accomplished with "intelligence".
(additional coding, conditionals, etc.)

There is also a sequence that must be followed, where certain things need to be
done before others. (and also on "sub-sections" of text for multi-highlighting,
and text sections of comments and quoted strings, which have a certain
prevalence or precedence)

All three of those situations get you correct syntax highlighting.

For "multi-highlighting", you need to perform the highlighting for the primary
language first, and then a succession of additional highlighters ONLY on the
sub-sections involved. (that is, HTML, which can be the most difficult,
especially for PHP (and ASP) documents, and Javascript sections and CSS
sections)

It's not an easy thing to do correctly.

-- 
<http://forum.pspad.com/read.php?2,32787,54423>
PSPad freeware editor http://www.pspad.com

Odpovedet emailem