Skip to Content

REGEXEXTRACT

Extracts strings within the provided text that match a regular expression pattern

Syntax

REGEXEXTRACT(text, pattern, [return_mode], [case_sensitivity])

Parameters

  • text: Required. The text from which to extract matches
  • pattern: Required. The regular expression pattern to match
  • return_mode: Optional. 0=first match (default), 1=all matches, 2=all capture groups
  • case_sensitivity: Optional. 0=case-sensitive (default), 1=case-insensitive

Example

=REGEXEXTRACT("ID: 12345", "[0-9]+")
Returns: String or ArraySince: Microsoft 365