Hello,

I would like to use they key lens to capture part of a regular expression, to 
use as the label. Is this possible using a POSIX extended regular expression 
capture? It does not seem work. E.g.: key /foo(bar)/ -> label of “bar”.

Background: I am writing a lens to parse one of the proprietary configuration 
formats used by my company’s products. At the moment I am capturing the name of 
an array using something like:

  key /[A-Za-z0-9_:]+[ \t]+=/

which, for example, results in a key like “uri =“. I would like it be more like 
“uri”. Ideally I’d like it to be “uri()” to indicate it’s an array.

The reason I’m matching the equals sign is to disambiguate the lens from 
another lens, to avoid ambiguities during the put operation.

Presumably POSIX ERE captures don’t work because the whole label is needed in 
order for the put operation to work?

Thanks, best regards, Richard Dawe

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

Reply via email to