
5 Jun
2009
5 Jun
'09
9:34 a.m.
Chandrashekhar Kumar wrote:
But it is not working for the below as well:
1.0,2.0,3.0,4.0 5.0,6.0,7.0,8.0
The question why this doesn't work can be simplified to the question why bool matches = parse ("1.0,2.0,3.0,4.0\n5.0,6.0,7.0,8.0", real_p >> *(',' >> real_p) , space_p).full; will result in matches being "false". I think the reason is that the skip parser "space_p" will eat the "\n" between "4.0" and "5.0", but it will not insert a ','. A potential solution might be to make ',' optional by writing !',': bool matches = parse ("1.0,2.0,3.0,4.0\n5.0,6.0,7.0,8.0", real_p >> *(!',' >> real_p) , space_p).full; will probably result in matches being "true". Regards, Thomas