I'm writing a major mode for a language that uses
(* ... *) as comments.
I'm trying to match multi-line comments. e.g.
(* foo bar *)
I was initially doing
. doesn't match newline.
I then tried what the wiki on multi-line regex said:
"(\\*[\0-\377[:nonascii:]]*\\*)". However, this leads to matching that I wasn't expecting. For instance, if I have the following:
(* comment 1*) code block 1 (* comment 2*) code block 2 (* comment 3*) code block 3
It highlights everything from
comment 1 to
comment 3 as a big comment, including
code block 1 and
code block 2.
How can I get it to match
(* to the first closing
*) rather than the last one?