I need to add some sort of substring/regexp matching to path
expressions. For example, I'd like to pick out all the aliases for
network interface eth0; they have an entry 'DEVICE=eth:N' where N is
some number. Ideally, I could say

        match /files/etc/sysconfig/network-scripts/*[DEVICE =~ /eth:[0-9]+/]

That causes some syntactic headache, though, since the notation /RE/ for
regexps is too close to normal paths, and it becomes very hard to tell
whether

        defvar x /foo/
        
defines a regular expression or a nodeset.

In a nutshell, I am looking for a different notation for literal
regexps, one that fits well into the path expression language, but is
also not so weird that nobody will ever be able to remember it. Options
as far as I can see:

      * Use a function that turns a string -> regexp, i.e. something
        like "regexp('eth:[0-9]+')"
      * Ruby-like notation: "%r{eth:[0-9]+}"
      * Some other delimiter than '/', e.g. "@eth:[0-9]+"

Any opinions on that ? Does anybody know of any commonly-used notation
not covered by the above ?

David


_______________________________________________
augeas-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/augeas-devel

Reply via email to