hercules-team / augeas

A configuration editing tool and API
http://augeas.net/
GNU Lesser General Public License v2.1
486 stars 199 forks source link

Greedy Lens Operators #138

Open orbisvicis opened 10 years ago

orbisvicis commented 10 years ago

Greedy or Leftmost versions, as suggested by Greedy disambiguation and in solution to Inexpressible Language:

| --> ||
. --> ..
* --> **
? --> ??
orbisvicis commented 10 years ago

Alternatively provide a construct (builtin) to invert a match (regex or lens). For example:

let lns = record | (invert record) . (del /.*/ "")

I assume it would be inherently zero-width.

orbisvicis commented 10 years ago

Alternatively provide if elif else construct.

orbisvicis commented 10 years ago

To be fair, regex subtraction provides a limited form of inverted matching (non-zero-width negative lookahead). Unfortunately regex subtraction does not seem capable of handling Inexpressible Language.