"names_w_grp_count"
int => readstringarray(
"names_with_group",
"$(perm_file)",
"(\s*#[^\n]*)|(^.[^\n]*:\s*(\n|\z))",
":",
"inf",
"inf"
),
comment => "Comment expression prunes lines which end with a colon";
"names_w_no_grp_count"
int => readstringarray(
"names_with_no_group",
"$(perm_file)",
"(\s*#[^\n]*)|(^.(?![^\n]*:\s*(\n|\z))[^\n]*(\n|\z))",
":",
"inf",
"inf"
),
comment => "Comment expression prunes lines which do not end with a colon";
I've tested both expressions using pcregrep, and each line appropriately #comments as well as the appropriate lines which either end or don't-end with colons (possibly with trailing whitespace). However, CFEngine doesn't seem to like the second expression (the one with the zero-width negative look-ahead). It gives this error message:
Danny,
Try this: