26 Apr
2015
26 Apr
'15
4:37 p.m.
On 26/04/2015 16:06, Fu ji wrote:
Hello all, I have file output.txt, in file we can find something like:
01/01/2015 15:00:00 2222.2222
2222.2222 2222.2222 2222.2222
04/04/2015 15:00:00 2222.2222
and i would like to change format from DD/MM/RRRR HH:MM:SS to RRRR-MM-DD HH:MM:SS.000 using boost regex. But I have no clue how should I type pattern and replace them with another.
Anyone have knowledge about boost regex and could help me ?
To take only the first part of the problem, then off the top of my head, something like: boost::regex e("(\\d{2})/(\\d{2})/(\\d{4})"); Then if the contents of the file are in "mystring": mystring = regex_replace(mystring, e, "$3/$2/$1"); HTH, John.