Intelligent string parsing