[augeas-devel] regex syntax

Greg_Swift at aotx.uscourts.gov Greg_Swift at aotx.uscourts.gov
Thu Jul 17 16:54:46 UTC 2008



I'm building a lens for Informix Dynamic Server's onconfig file.  After
getting both David and Raphaël to try and go over something with me on IRC,
and Raphaël even providing me with his interpretation of how I should
proceed I have sat down and played with it a bit more.

augparse is helpful, although after that help I quickly got to the point
where that was successful, but parse still failed.   To be quite honest, i
think I like looking in augtool at /augeas/files/*/error and /lens more.
Maybe that's just me.  Anyways.  I realize I need to write a test, and I
will go and start learning that after I write this e-mail.

My question goes into why + over *.  I ask this because I tried manually
playing with the regex that is generated by augeas at the cli from the
lenses and taking them down to the smallest individual bits, and most of my
matching, like [ \t]+, don't work.  But if I put the * instead of the +,
they work.  Now admittedly I haven't gotten my lens to fully parse yet
anyways.

I know * is zero or more occurrences, whereas I think + is one or more
occurrences, correct?  My concern though is that it doesn't seem to be
working for me.  On that same note, I was using aliases.aug as a tutorial
for some of my work and noticed that it does not properly parse my
/etc/aliases.  This same change fixed the issue.

The current aliases.aug takes the following 2 formats ito account in
/etc/aliases:

alias1:     target
alias2:     target1, target2, target3

Whereas myself, the mail server, and probably others might handle a list in
this format:
alias3:     target4,target5,target6

The line (13) looks like this:
 let comma = del /,[ \t]+(\n[ \t]+)?/ ", "

but I think it should be:
 let comma = del /,[ \t]*(\n[ \t]+)?/ ", "

If you would like to see where I am going with this on the lens I am
working on you can reference the files I am attaching.  The 3 files I am
attaching are:

1: informix.aug
2: onconfig.test (sample config file)
3: onconfig.txt (my "explanation" of the config in plain english)


Most specifically I am refering to flag, subflag and ws.

(See attached file: onconfig.test)(See attached file: informix.aug)(See
attached file: onconfig.txt)

-greg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: onconfig.test
Type: application/octet-stream
Size: 456 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20080717/8b6f2e6f/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: informix.aug
Type: application/octet-stream
Size: 755 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20080717/8b6f2e6f/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: onconfig.txt
Type: application/octet-stream
Size: 553 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20080717/8b6f2e6f/attachment-0002.obj>


More information about the augeas-devel mailing list