On 2012-04-02, steve wrote:
> Hi,
> 
> 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.
> 
> I'm no regex guru, so could someone help me please?

Take a look at the mutt manual, in the Regular Expression section.
There it says that the beginning and end of a word are matched with
'\\<' and '\\>', respectively.

Quoting in mutt has always confused me.  Try "\\<etch\\>" alone
first.  If that doesn't work, try adding backslashes until it does.
Then expand your expression from there.

HTH,
Gary

Reply via email to