Improve string delimiter detection