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

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

Re: Trying to font-lock between parenthesis


From: Jules Colding
Subject: Re: Trying to font-lock between parenthesis
Date: Sat, 29 Nov 2008 11:29:19 +0100


On 29/11/2008, at 08.55, Drew Adams wrote:

   ("\\(\(.*\)\\)" 1 font-lock-constant-face t)
But the regexp is wrong as the enclosing parentheses are
including in the colouring to. What regexp will let me
choose the text between the parenthesis but not the
parentheses themselves?

("(\\(.*\\))" 1 font-lock-constant-face t)

But you probably don't want to allow parens between the parens, so maybe
something like this:

("(\\([^()]*\\))" 1 font-lock-constant-face t)

Or if you just want word and symbol constituents between the parens, then
something like this:

("(\\(\\(\\sw\\|\\s_\\)*\\))" 1 font-lock-constant-face t)

It works perfectly :-)

Thank you so very much!
  jules





reply via email to

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