[augeas-devel] [PATCH] Add regexpi to XPath syntax for case insensitive regexps

David Lutterkort lutter at redhat.com
Thu May 31 21:14:56 UTC 2012


On Thu, 2012-05-31 at 10:20 +0200, Raphaël Pinson wrote:
> Quite a few configuration files support case insensitive keys. This is the
> case of the (newly committed) postgresql.conf.
> 
> With this new regexpi function, we can do things like this:
> 
> augtool> match /files/etc/postgresql/8.4/main/postgresql.conf/*[label() =~
> regexp('default_text_search_config')]
>   (no matches)
> augtool> match /files/etc/postgresql/8.4/main/postgresql.conf/*[label() =~
> regexpi('default_text_search_config')]
> /files/etc/postgresql/8.4/main/postgresql.conf/DEFAULT_teXt_search_config =
> 'pg_catalog.english'

I wonder if we shouldn't just make path expressions match case
insensitive, so that the path expression /foo/bar also matches
{ "Foo" { "BaR" } } ... are there any examples where case matters and we
would get unwanted matches ?

David





More information about the augeas-devel mailing list