TextMicrosoft 365

REGEXEXTRACT

Pull text matching a regular-expression pattern out of a string.

Syntax

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

Worked example

Extract a shipment reference from a note.

=REGEXEXTRACT("Ref: PK-921","PK-[0-9]+")

Result PK-921

Microsoft documentation

Check the arguments, supported editions and behavior of this function in Microsoft’s reference.

Microsoft reference

Search ExcelTutor