[augeas-devel] Getting pattern and checking values against regexp

Raphaël Pinson raphink at gmail.com
Thu Jul 24 07:23:18 UTC 2008


Good day,

I was thinking about some functionality that would be useful in Augeas (or
maybe I don't know that they already exist :) ).

It might be useful for developers using the Augeas API to access the pattern
that Augeas is considering for values. For example, if a dev created a
graphical interface using Augeas, they might want to check the values
provided by users against the regexp describing these values. Such a
function could have a syntax like 'pattern(path)'

 pattern("/files/etc/logrotate.d/apache2/rule/file")
=> /[^,# \n\t{}]+/


This kind of check could also be performed internally by Augeas on request
through the API, using a check(path, value) function similar to set :

 check("/files/etc/logrotate.d/apache2/rule/file", "afile")
=> true
 check("/files/etc/logrotate.d/apache2/rule/file", "my value")
=> false


Raphaël
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20080724/1c426116/attachment.htm>


More information about the augeas-devel mailing list