I have a string with some text for instance:
string str = "this is some text $variable some more text $random[1,6]";
Now I want to replace variables that are in map <string, string>.. For instance replace $variable (map->first) with map->second.. and when replacing $random, call a function randomize (in range) and then replace variable with lets say 439204..
I decided to go for boost::regex, but Im unsure what would be the best approach, since I dont have to call random function if I dont have that variable in string.. What do you think would be the best approach for this?
Thanks a lot for help