Skip to main content
regexall(pattern, string) applies the RE2 regular expression pattern to string and returns all matches as a list. Each element has the same shape as a single regex result: a string for no-capture-group patterns, or a tuple/object for patterns with capture groups.

Signature

Example

Find all GitHub issue references in a commit message and include them in the release notes command:
For "Fixes #123 and #456 closes #789", computed.issue_refs becomes ["#123", "#456", "#789"].

Notes

  • regexall returns an empty list when there are no matches. This makes it safe to use in conditions with length.
  • Each match element is a string when the pattern has no capture groups. With capture groups, each element is a tuple of the captured values (or an object for named groups).
  • Use regex when you only need the first match.