How can I create an Augeas lens that will allow me to extract a value field from within a parenthesis?
Background:
I'm starting an Augeas lens for managing NASL files for OpenVAS. I need to be able to make a few arbitrary changes to a large number of these scripts.
NASLs contains a lot of key and value pairs which are all surrounded by parentheses as shown below, sometimes with multiple values.
This is a sample line I'm working with. I'm not using any line breaks, comments, etc in my test script yet. The line here is exactly what I'm using.
script_id(100197)
The basic format I'm trying to use for the extraction is:
let digits = store /\d+/
let oparen = Util.del_str "("
let cparen = Util.del_str ")"
(* script_id(100197); *)
let script_id = [ key "script_id" . oparen . digits . cparen ]
And the resulting error from augparse is:
Error encountered at 1:0 (0 characters into string)
<|=|script_id(100197)>
Tree generated so far:
<blank>