REGEXEXTRACT

  • Updated

Extracts matching substrings according to a regular expression.

Sample Usage

REGEXEXTRACT("Spreadsheet.com","read")
REGEXEXTRACT(A1,"abc")
REGEXEXTRACT(A1,A2)

Syntax

REGEXEXTRACT(text,regular_expression)

  • text - The input text. 
  • regular_expression - The regular expression. The first part of text that matches this expression will be returned.

 

Examples

REGEXEXTRACT("Spreadsheet.com","read") returns 'read', as a part of the string matches with the regular expression "read". 
REGEXEXTRACT(A1,"abc") returns the part of cell A1 that matches with the regular expression "abc". 
REGEXEXTRACT(A1,A2) returns the part of cell A1 that matches with the regular expression contained in cell A2.

Notes

  • This function only works with text as input and returns text as output.