Hmm, your C++ code doesn't seem to have any usage of regular expressions or I am not seeing it.

Cheers,
_