steve schrieb am 02.04.2012 um 22:01 (+0200):
> 
> I'm trying to write a regexp in order to capture some words to put
> them in color. I have a line like this in my .muttrc:
> 
> color body red default 
> "\<etch\>|((L|l)enny)|((S|s)queeze)|((S|s)arge)|((P|p)otato)"
> 
> I want to catch only etch, but not fetch nor fetchera (or whatever
> combination). So I tried the \<word\> syntax without success. I also
> tried the Perl way \bword\b which fails too.

So you want word boundaries. I found out double backslashes work fine:

  color body red default "\\<etch"

While hacking away at the regex in the conf file and testing in mutt
reloading the conf, it's easy to get fooled by the cumulative effect of
all regexes tried along the road … so it's important to make tabula rasa
for your combination by doing:

  :uncolor body red default *

Michael

Reply via email to