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: Drew Adams
Subject: RE: Trying to font-lock between parenthesis
Date: Fri, 28 Nov 2008 23:55:09 -0800

>     ("\\(\(.*\)\\)" 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)





reply via email to

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