DefinitelyTyped/xregexp
Bibby 1cef384b4f modified xregexp.d.ts
=======================================================
// Matchception: Finding matches within matches, while passing forward and
// returning specific backreferences
html = '<a href="http://xregexp.com/api/">XRegExp</a>' +
       '<a href="http://www.google.com/">Google</a>';
XRegExp.matchChain(html, [
  {regex: /<a href="([^"]+)">/i, backref: 1},
  {regex: XRegExp('(?i)^https?://(?<domain>[^/?#]+)'), backref: 'domain'}
]);
// -> ['xregexp.com', 'www.google.com']
2014-12-30 00:32:11 +08:00
..
xregexp-tests.ts modified xregexp.d.ts 2014-12-30 00:32:11 +08:00
xregexp.d.ts modified xregexp.d.ts 2014-12-30 00:32:11 +08:00