Which is the OP's issue as well: they'd be better off letting somebody else like Google parse their text instead of trying to reinvent the wheel.
Reply on news.ycombinator.com