但不是空字符串?
// loop through space separated "tokens" in a string
// will loop through "" - needs update
$P.eachString = function (str, func, con) {
var regexp = /^|\s+/;
if (regexp.test(str)) {
// ... stuff
}
};
上面的代码将匹配 "" 空字符串。我想匹配
情况1
some_string
案例2
some_string1 some_string2
案例3
some_string1 some_string2 some_string_3
等等