On the inverse: How do I define a regex?
Since has_extra_files() is a bit slow, I'm adding the count to my admintags column with a template that:
1. Use a regex to match and remove any existing extra_files entries.
2. Generate a new extra_files entry.
3. Remove any entries matching 'extra_files:' exactly (zero files).
However, the regex on line 6 is failing to match:
Code:
program:
#to be replaced with $#admintags
tags = 'extra_files:123, blahblah';
old_tag = 'extra_files:\d+';
filecount = strcat('extra_files:', has_extra_files());
clean_tags = list_difference(tags, old_tag, ',');
new_tags = list_union(filecount, clean_tags, ',');
nonzero = list_difference(new_tags, 'extra_files:', ',')
I also tried
strcat('extra_files:', '(\d+)');