No: Excel’s standard Find and Replace dialog does not support regular expressions (regex). In Microsoft 365, you can use regex in worksheet formulas with functions such as REGEXTEST, REGEXEXTRACT, and REGEXREPLACE; for simple searches in the dialog, Excel offers wildcards instead.
What Excel Find and Replace supports
In Excel for Microsoft 365 on Windows, press Ctrl+H or choose Home > Find & Select > Replace to open the replacement controls. The Find what and Replace with boxes do not interpret regex syntax. Typing a pattern such as \d{4} will not make the dialog find any four digits. Excel treats those characters as ordinary search text unless they happen to match the cell contents literally.
The dialog does have useful options. Select More Options to choose where Excel searches, whether it looks in formulas or displayed values, and whether the search should match case or the entire cell. The Use wildcards checkbox enables Excel’s simpler wildcard rules. Those rules can match broad patterns, but they are not a full regex engine.
This distinction matters because “find text that looks like a pattern” can mean two different things. A wildcard search can locate cells containing a loose text pattern. A regex can describe more exact rules, such as “two uppercase letters, a hyphen, then exactly four digits.” The standard dialog cannot express that rule with regex syntax.
How Excel wildcards differ from regex
With Use wildcards selected, Excel recognizes three wildcard characters in Find what:
*matches any number of characters, including no characters.?matches exactly one character.~escapes a wildcard, so~*searches for a literal asterisk and~?for a literal question mark.
For example, searching for north* can find text beginning with “north” followed by any characters. Searching for AB-?? can match “AB-” followed by any two characters. These searches do not check whether those final characters are digits, letters, or another particular type. Regex character classes and quantifiers can make that kind of distinction; Excel’s Find and Replace wildcards cannot.
Wildcards can still be enough for common tasks, such as finding entries with a known prefix or locating text that ends in a particular suffix. Leave Use wildcards unchecked when you want Excel to search for a literal asterisk or question mark, or use the tilde escape when wildcard searching is on. If you use a wildcard in a replacement operation, review the results carefully: the dialog does not provide regex capture groups that let you rearrange the parts matched by a pattern.
Using regex functions in Microsoft 365
Microsoft 365 includes regex worksheet functions in builds where the feature has been made available. REGEXTEST checks whether text matches a pattern, REGEXEXTRACT returns matching text, and REGEXREPLACE substitutes text that matches a pattern. These functions put regex into a formula; they do not add regex mode to the Find and Replace dialog. Availability can depend on your Microsoft 365 update channel and app version, so an older or organization-managed installation may not show the functions yet.
For example, with a product code in A2, the following pattern checks for exactly two uppercase letters, a hyphen, and four digits:
With the product code in A2, enter =REGEXTEST(A2,"^[A-Z]{2}-[0-9]{4}$"). If A2 contains QZ-4821, the result is TRUE; if it contains QZ-482 or Qz-4821, the result is FALSE.
The symbols have specific meanings: ^ marks the start of the text, $ marks its end, [A-Z] allows one uppercase letter, and {4} requires four of the preceding item. The anchors are important. Without them, a pattern may match a valid-looking portion inside a longer, otherwise invalid string.
Regex functions use a regex syntax based on PCRE2, but syntax and behavior can differ among regex engines. A pattern copied from a programming language, website, or another spreadsheet may need adjustment. Check the function’s help in your Excel version when a pattern uses advanced features.
Examples of pattern-based cleanup
Regex replacement is useful when the characters to remove or change follow a consistent rule. Suppose A2 contains Order 47, ref 903 and you want to remove every digit. With the source text in A2, enter =REGEXREPLACE(A2,"[0-9]",""). The result is Order , ref : each digit is replaced with an empty string. This example removes digits wherever they appear, so it is not appropriate if some numbers must be preserved.
To extract a code from a longer cell, use a pattern that identifies the code’s structure. With text in A2 that includes a code such as Ticket: QZ-4821 received, enter =REGEXEXTRACT(A2,"[A-Z]{2}-[0-9]{4}"). The result is QZ-4821. Unlike a Find and Replace search, this formula returns the matched substring in a cell, leaving the source value unchanged.
That last point is a practical difference: regex formulas produce results rather than editing the original cells in place. Put the formula in a neighboring column, fill it down, and inspect the output. If you need to overwrite the original data, copy the reviewed results and use Paste Special > Values. Keep a copy of the original column first, especially when cleaning important records.
How to choose the right method
Pick the method based on what the pattern needs to do and whether you want a reversible result:
- Use Find and Replace for a known literal change, such as replacing every occurrence of
Ltd.withLimited. - Use wildcard search when a broad prefix, suffix, or one-character match is enough and you want to work in the dialog.
- Use REGEXTEST when you need to validate whether each cell follows a rule, such as a required code format.
- Use REGEXEXTRACT when you want to return a matching portion into another cell.
- Use REGEXREPLACE when you need to remove or replace text that matches a more detailed pattern.
For a one-time cleanup, a formula in a helper column makes it easy to compare source and result before committing changes. For repeated imports or a process other people must run consistently, document the rule and keep the original data. If the regex functions are unavailable in your Excel build, consider updating Microsoft 365 if your organization permits it, or use an approved alternative workflow rather than assuming the dialog accepts regex.
Common problems and safe checks
A frequent mistake is expecting regex symbols to work in Find and Replace. The dialog’s * and ? are Excel wildcards, while regex uses those characters differently: in many regex patterns, * repeats the item before it and ? makes an item optional. The same symbol therefore does not guarantee the same behavior in both tools.
Another issue is matching only part of a cell when you meant to validate the whole value. In a regex formula, use start and end anchors when every character must satisfy the rule. Also consider capitalization: a pattern such as [A-Z] describes uppercase letters, while the regex function’s case-sensitivity settings can affect matching. Test several valid and invalid examples before filling a formula down a large list.
Before running a bulk replacement, use Find Next or inspect a small sample, confirm the search scope, and check whether Excel is searching formulas, values, or notes. A replacement applied to the wrong sheet or workbook can be difficult to reverse after saving. For formula-based cleanup, retain the source column until you have checked the results; a blank or unexpected result may indicate that the pattern did not match as intended.
Alternatives when regex functions are unavailable
If your Excel installation does not recognize REGEXTEST, REGEXEXTRACT, or REGEXREPLACE, first check for Microsoft 365 updates and confirm that your organization has not delayed feature updates. A formula showing #NAME? may indicate that the function is not available in that installation, although spelling and formula-entry errors should also be checked.
For straightforward changes, ordinary Find and Replace or the wildcard option may be sufficient. For structured, repeatable data transformations, Power Query can split columns, extract text, replace values, and apply other built-in transformations without regex. It is not a drop-in regex-enabled version of the Find and Replace dialog, so check whether its available operations fit your specific rule. A VBA macro is another possibility for a customized process, but it requires code and appropriate macro permissions; preserve a workbook copy before running one.
Frequently Asked Questions
Can I use regex in Excel’s Ctrl+H dialog?
No. Ctrl+H opens Excel’s Find and Replace dialog, which supports literal searches and optional Excel wildcards, not regular expressions. Regex formulas are a separate feature.
Does Excel support regex in Microsoft 365?
Microsoft 365 builds that include the regex functions support regex in REGEXTEST, REGEXEXTRACT, and REGEXREPLACE formulas. Availability may depend on the update channel or managed installation. This does not make regex available in the dialog.
What is the difference between Excel wildcards and regex?
Excel’s * matches any number of characters and ? matches one character when Use wildcards is on. Regex offers more detailed rules, such as digit classes, repetition counts, alternatives, and text anchors.
Can REGEXREPLACE change cells directly?
No. It returns a result from a formula, usually in another cell. To replace the original data, review the formula results, copy them, and paste values over the source if that is what you intend.
Why does Excel show #NAME? for a regex function?
Your Excel version may not include that function, or the feature may not yet be available on your Microsoft 365 update channel. Verify the spelling and check for updates or your organization’s update policy.
Related
- Excel Day Today: Find Today’s Date and Day Number
- Excel Data to Word: Choose the Best Way to Transfer It
- Conditional Formatting in Excel: How It Works
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Create an Automatic Email Signature in OutlookTo create an automatic signature in Outlook, open the signature settings for your version of Outlook, write and…
- Schedule Daily Email in Outlook: Options and StepsOutlook can schedule a message to send once, but it does not provide a built-in setting to repeat…
- Clear Outlook Global Address List Cache in OutlookTo clear the Global Address List (GAL) cache in classic Outlook for Windows, open Send/Receive > Send/Receive Groups…
- Make a Flowchart in Word for Mac: Steps and Tips That WorkTo make a flowchart in Word for Mac, choose Insert > Shapes, add flowchart shapes such as process…
- Excel Quick Analysis Button: What It Does and How to Use ItIn Excel for Microsoft 365 on Windows, select a range of data and click the Quick Analysis button…
- Excel Cell Height Limit: Maximum Row Height ExplainedIn Excel for Microsoft 365 on Windows, the maximum row height—and therefore the height of every cell in…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.