You're looking at a somewhat complicated problem. To understand it you'd have to understand parsing lexing and tokenizing. Sorry I can't be of much help.
thanks for the info, but im trying to avoid curl or curlpp for some reasons. im planning on using InternetReadFile but I can't find any good example regarding to my problem.