REGEXEXTRACT

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

Returns the characters that match a regular expression.

textThe text string.
patternThe regular expression.
return_mode(Optional) The type of string you want to return:
0 = The first string that matches the pattern (default)
1 = All the strings that match the pattern as an array
2 = The capturing groups from the first match as an array.
case_sensitivity(Optional) A logical value indicating whether to ignore the case:
0 = Case sensitive (default)
1 = Not case sensitive

REMARKS
* This is a Preview Function which means the signature and results may change before being officially released.
* This function was added in Microsoft 365.
* link - insider.microsoft365.com/en-us/blog/new-regular-expression-regex-functions-in-excel
* You can use the REGEXREPLACE function to return the text string after replacing characters that match the pattern provided.
* You can use the REGEXTEST function to return True or False depending if the pattern matches any part of a text string.
* This function was first released in June 2024.
* For the Microsoft documentation refer to support.microsoft.com
* For the Google documentation refer to support.google.com

 A
1=REGEXEXTRACT("Mat Taylor (123) 456-7890","[0-9()]+ [0-9-]+",1) = (123) 456-7890

1 - Extract the phone number based on the pattern "[0-9()]+ [0-9-]+".

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top