
TextLevel: ExpertAvailable in: Excel 365 / 2021+
In this article
- Syntax
- Examples
- Example 1
- Related functions
REGEXTEST returns TRUE if text matches a regular expression — validate PAN numbers, emails or codes in one formula.
Syntax
=REGEXTEST(text, pattern, [case_sensitivity])
| Argument |
What it means |
pattern |
A regular expression. |
Examples
Example 1
=REGEXTEST(A2, "^[A-Z]{5}[0-9]{4}[A-Z]$")
Checks the PAN format (5 letters, 4 digits, 1 letter).
REGEXEXTRACT · REGEXREPLACE
📚 Part of the free Excel course: Beginner → Expert · Try it in the Formula Lab or ask the AI Helper.
✨ Ask AI about this articleStuck on a step? Ask a question and the AI answers using this article.
Free · AI can be wrong