
Robert Dailey wrote:
Thank you very much for helping. I wouldn't go as far as to say it isn't hard, because that looks very hard IMHO. I was hoping for something a little more intuitive and built-in. Instead of going through all of that work I will probably first try to find a different third party regular expression library that can automate this task for me so that I can keep my code a little cleaner and focus on the actual task.
Hm, OK. Good luck. Maybe Boost.Regex has this feature.
I know that other regex libraries in other languages provide such a feature. Perhaps in the future Boost.Xpressive can be extended to provide this behavior. You could simply create a version of regex_replace() that takes a functor as the replacement instead of a string.
Nothing is simple. It would require careful design work, tests and docs. If you feel strongly about it (and it /would/ be useful), you can open a feature request on svn.boost.org. Or even better, submit a patch. This is open source, after all, and I welcome your participation. -- Eric Niebler Boost Consulting www.boost-consulting.com