<<< Date Index >>>     <<< Thread Index >>>

Re: matching square brackets in hooks



* Volker Kuhlmann <list0570@xxxxxxxxxxxxxxx> [2005-11-10 13:01 +1300]:
> (strings inside single-quotes are taken as literal, manual 3.1)

By the config file parser, not by the regex engine.

>   fcc-save-hook '~s "\[aaa-bbb\]"' =box

The backslashes are removed before the regex engine gets the string.
You have to escape them often enough, but I'm too tired to calculate
the correct number. The easy way would be to just try it.

I think doubling or trippling them should help.

> However, no mention is made of escaping special regex characters to have
> their meanings reverted to literal is made in manual section 4.1. As the
> regex engine is clearly stated as POSIX or gnu awk, I expect a \[ to
> mean a literal bracket.

Yeah, that works, but you have to pass \[ to the regex engine.

> This appears to be not so, as 
> 
>   fcc-save-hook "~s '[[]aaa-bbb[]]'" =box
> 
> actually works.

Why not just use that?

> 2) The behaviour of mutt which seemingly differs from the manual needs
> to be documented clearly. The manual needs to be corrected to describe
> actual mutt behaviour, and this should be illustrated with an example as
> it's very unexpected behaviour.

Where does it differ?

Nicolas

-- 
http://www.rachinsky.de/nicolas