Please, read this:
http://stackoverflow.com/a/13676265

What about hexadecimal numbers? Scientific notation? Empty strings with \t, \r, \s? Consider trimming by the way.