```{index} single: match (Peta::PCRE2) ``` ```{index} single: Peta::PCRE2::match ``` # match Match the pattern against a subject string once. Returns a list of byte-offset pairs: `(start, end)` of the whole match followed by one pair per capture group (`undef, undef` for groups that did not participate), or the empty list on no match. An optional `$startoffset` (byte offset, default 0) begins the match part-way into the subject; an offset past the end of the subject returns the empty list. Call it in list context. In scalar context you get the last value pushed, which is the end offset of the final pair, not a count and not a boolean. ## Synopsis ```perl my ($s, $e, @captures) = $re->match($subject); while (my ($s, $e) = $re->match($subject, $pos)) { $pos = $e; } ```