/[^\s]+/g equals to /\S+/g, but the former is hard to understand.