Find the ranges of text that regexp matches, as [start, end] pairs.
text
regexp
[start, end]
Every match is returned when regexp has the global flag, otherwise only the first one. Empty matches are left out, as there is nothing to wrap.
Find the ranges of
textthatregexpmatches, as[start, end]pairs.Every match is returned when
regexphas the global flag, otherwise only the first one. Empty matches are left out, as there is nothing to wrap.