正则查找重复

  var s = "1 5 2 4 5";

  var reg = /(\d)(.)(?=.*\1)/;

  alert(reg.test(s));

原文地址:https://www.cnblogs.com/chentao5211314/p/1980021.html