When trying to replace the cout's I had used for debugging for a more elaborate logging function. I ran into the following problem:
A message currently is constructed like this:
testValue;
cout << "value" << testValue;
And should become this:
logger->log("value" + SSTR(testValue), program_component, 2);
Where SSTR is a custom macro that converts the in into a string.
What I don't know how to do however, is how to replace any number of outputs?
What I've got so far is this expression:
cout((?([^\r\n])\s)*\<\<(?([^\r\n])\s)*((?<string>(\".*?\"))|(?<id>(\b(_\w+|[\w-[0-9_]]\w*)\b))))*
and this replacement pattern:
log(${id}, programComponent, 2)
I'd really appreciate any help :)
Kind Regards, Lauris