I'd like to match all lines to some regex (say "label: 1, 2, 3") and do some arithmetic on the values obtained, then rewrite part of the line (say "label: $6.40").
In PHP I'd do a pcre_replace() with a callback. What's the nim way? map over an array of matches? That way I would lose the context of the string to substitute in.
Works for me, but there is no nim way then, not even pegs?
This is a really important omission in the standard re lib. Wikis for example rely on this capability.
Thanks.