search

Home  >  Q&A  >  body text

javascript - Problems with new in regular expressions

var txt="\457";
var re=/\+\d+/; //  开头为数字 中间任意多个\w  结尾为1个数字
var re1 = new RegExp('\{1}\d+')
alert(re1.test(txt));//false

为什么rel的匹配规则不对呢?求赐教!
習慣沉默習慣沉默2829 days ago358

reply all(1)I'll reply

  • 怪我咯

    怪我咯2017-05-19 10:25:56

    \d 都 \d了
    \ 为什么不同有 \\呢?

    reply
    0
  • Cancelreply