help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: regular expression help (again)


From: Luca Ferrari
Subject: Re: regular expression help (again)
Date: Thu, 24 Jan 2013 10:23:38 +0100

As far as I can see here
http://www.emacswiki.org/emacs/MultilineFontLock using multiple lines
is not enough simple to wrap it into a single regexp and appears also
to be a bad idea.

Luca

On Thu, Jan 24, 2013 at 8:22 AM, Luca Ferrari <fluca1978@infinito.it> wrote:
> Hi,
> there is something I'm missing: I'm still writing my mode for a
> programming language and I'd like to set a font-lock for a block of
> lines that begins with /SOMETHING and ends with /* like the following:
>
> /MASK
> Field 1: _____
> Field 2: _____
> /*
>
> So I defined the following regular expression to first match the whole block:
>
> "^/\w+[ \t\n]+(.*\n)/\*$"
>
> but it is not working, in particular testing it against
> re-search-forward the \w+ works as expected but the [ \t\n]+
> subsedquent part is blocking the regular expression. What am I doing
> wrong?
>
> Second question, within the same block would it be possible to set a
> fot-lock for any word that is not made by underscores and to set
> another font-lock for any _ found in the block? I need a little
> suggestion about this (if possible).
>
> Thanks,
> Luca



reply via email to

[Prev in Thread] Current Thread [Next in Thread]