[augeas-devel] Matching [argument=""] with a regular expression

David Lutterkort lutter at redhat.com
Thu Feb 18 18:31:06 UTC 2010


On Thu, 2010-02-18 at 10:31 -0500, Ed wrote:
> Does augeas currently support regular expression matching inside of
> argument string matching?

Yes, that's possible, as of Augeas 0.6.0. As an example, this path
expression finds all entries in /etc/hosts whose IP address starts with
'192.':

        /files/etc/hosts/*[ipaddr =~ regexp("192\..*")]
        
You construct a regexp by passing a string with a regexp in extended
POSIX regex syntax to the regexp() function and match it against a node
with the '=~' operator.

David





More information about the augeas-devel mailing list