【发布时间】:2015-07-14 12:53:38
【问题描述】:
我使用了一种模式来确保如果在 php 代码中运行的 char 比 3 相同并且它可以正常工作,但是当我在 javascript 中尝试它时它没有任何想法?
if (!(/(.)\\1{2}/.test(string))) {
console.log('there are no running 3 chars occur in the string');
} else{
console.log('there are 3 running same char occur in the string');
}
控制台给我“字符串中没有运行 3 个字符”虽然字符串是“iii”
有什么想法吗?
【问题讨论】:
标签: javascript string for-loop