@regexp-cjk/regex-iterator
v1.0.35
Published
regexp iterator util helpers
Downloads
44
Maintainers
Readme
README.md
regexp iterator util helpers
install
yarn add @regexp-cjk/regex-iterator
yarn-tool add @regexp-cjk/regex-iterator
yt add @regexp-cjk/regex-iterator
let html = '<a href="http://xregexp.com/api/">XRegExp</a>\
<a href="http://www.google.com/">Google</a>';
let actual = reduce(html, [
{ regexp: /<a href="([^"]+)">/ig, backref: 1 },
{ regexp: new RegExp('^https?://(?<domain>[^/?#]+)'), backref: 'domain' },
])
expect(actual).toStrictEqual(['xregexp.com', 'www.google.com']);