I am trying to read a long text, and am to separate this text into every word it contains. The first attempt I made was reading it from a file using `std::ifstream` and the `operator>>` to read into a string. The problem is, since it only cuts text on whitespace characters, I still get periods at the last word of a phrase (like `problem.`) and some special strings that don't mean nothing (sometimes I have `->` or `**`).

I thought on reading char by char, or splitting the string read char by char too, and finding removing the characters that aren't in the correct range (something between a-z, A-Z and 0-9), but this solution seems very messed up. Also, I could not use regular expressions since I'm using GCC 4.8.3 and it is not possible to use Boost.

Is there a better solution than this second one, or is this the good way? By good I mean relatively easy to implement and yielding the expected result (only alphanumeric characters).