Google Sheets REGEXMATCH Function: Syntax, Examples & Tips

The REGEXMATCH function checks if a text string matches a specified regular expression pattern, returning TRUE or FALSE.
Google Sheets
REGEXMATCH(text, regular_expression)

One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.

On this page
  1. Parameters
  2. What is a REGEXMATCH?
  3. A Practical Example
  4. REGEXMATCH Formula
  5. Result of the Formula
  6. Why Use REGEXMATCH?
  7. Key Takeaways:
  8. Example use case

Parameters

text:
The text or cell reference that you want to evaluate against the specified regular expression.

regular_expression:
The regular expression pattern that you want to match against the text. This defines the criteria for the match.

What is a REGEXMATCH?

The REGEXMATCH function in Google Sheets is a powerful tool used to determine if a text string matches a specified regular expression (regex) pattern. This function is particularly useful for validating data formats, searching for specific patterns within text, or filtering data based on complex criteria. Unlike simpler text functions, REGEXMATCH allows for advanced pattern matching, making it a versatile option for data manipulation.

In simpler terms, REGEXMATCH helps you check if a piece of text fits a certain pattern, which can be incredibly useful for tasks like data validation or extraction.

A Practical Example

Imagine you are managing a list of email addresses and you want to validate whether each email is in the correct format.

Email List:

You want to identify which email addresses are valid based on a standard email format.

REGEXMATCH Formula

To achieve this, you would use the REGEXMATCH function as follows:

Google Sheets
=REGEXMATCH(A2, "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$")

In this formula:

  • A2 is the cell containing the email address you want to validate.
  • "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" is the regex pattern that defines a valid email format.

Result of the Formula

When you apply the REGEXMATCH formula to the Email List, the output would look like this:

Email AddressValid?
john.doe@example.comTRUE
jane.doe@sampleFALSE
invalid-email@.comFALSE
user123@domain.orgTRUE

In this case, the formula returns TRUE for valid email addresses and FALSE for those that do not match the specified pattern.

Why Use REGEXMATCH?

REGEXMATCH is beneficial because it provides a robust way to validate and filter data based on complex patterns. It eliminates the need for multiple nested functions and offers a more efficient method for checking data integrity. Additionally, it allows for flexibility in defining patterns, making it suitable for various applications beyond just email validation.

Key Takeaways:

  • REGEXMATCH: A powerful function that checks if a text string matches a specified regex pattern.
  • Advanced Pattern Matching: Allows for complex criteria to be defined, making it suitable for various data validation tasks.
  • Efficiency: Simplifies the process of validating data formats, reducing the need for multiple functions.
  • Common Use Cases: Ideal for validating email addresses, phone numbers, and any scenario where pattern matching is necessary.

REGEXMATCH is an essential function for anyone working with data in Google Sheets, providing a powerful way to enhance data validation and analysis capabilities.

Happy spreadsheeting!

Example use case

You have a list of product codes in Column A and want to identify which codes are valid based on a specific pattern. Using REGEXMATCH, you can quickly filter and highlight valid codes, ensuring accurate inventory management without manual checks.

Need more help with Google Sheets formulas?

Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.

Explore all Google Sheets formulas

Browse our complete library of Google Sheets formula guides

Compare your options

Decide with evidence, not a sales pitch.

Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.

  1. 01ChatGPTOpen a balanced comparison prompt in ChatGPT.
  2. 02ClaudeOpen the same research prompt in Claude.
  3. 03PerplexityResearch the comparison with linked web sources.

AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.

REGEXMATCH in Google Sheets - Better Analyst