RegExp.prototype.sticky 属性

y修饰符相匹配,ES6 的正则实例对象多了sticky属性,表示是否设置了y修饰符。

  1. var r = /hello\d/y;
  2. r.sticky // true