<div dir="ltr"><br><br><div class="gmail_quote">On Thu, Jul 24, 2008 at 5:53 PM, David Lutterkort <<a href="mailto:dlutter@redhat.com">dlutter@redhat.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Thu, 2008-07-24 at 09:23 +0200, Raphaël Pinson wrote:<br>
> It might be useful for developers using the Augeas API to access the<br>
> pattern that Augeas is considering for values. For example, if a dev<br>
> created a graphical interface using Augeas, they might want to check<br>
> the values provided by users against the regexp describing these<br>
> values. Such a function could have a syntax like 'pattern(path)'<br>
><br>
>  pattern("/files/etc/logrotate.d/apache2/rule/file")<br>
> => /[^,# \n\t{}]+/<br>
<br>
</div>This would only be possible if that query is based on the current tree,<br>
since the pattern for a value can change depending on whether other<br>
nodes in the tree are present or not. For example,<br>
<br>
        let lns =  ([ key /u/ ] . [ key /b/ . store /[0-9]+/ ])<br>
                   | ([ key /v/ ] . [ key /b/ . store /[a-z]+/ ])<br>
</blockquote><div><br><br>Yes, I understand that problem, and I meant to use it against the
current tree. It would not be to check in general what a field could
contain, but in the context of the tree. Maybe my example was a bit
vague and I could have written <br>
<br>pattern("/files/etc/logrotate.<div>d/apache2/rule[2]/file[3]")<br>=> /[^,# \n\t{}]+/<br><br><br>Is that what you mean about using the current tree ?<br><br><br>Raphael</div><br> </div></div></div>