How to Fix Word Wildcard Search Errors Caused by Regional List Separators
Question details
Users experience invalid pattern errors when performing wildcard searches with quantifiers due to conflicts with Windows regional list separators.

- Product
- Microsoft Word
- Device & OS
- Windows
- Scenario
- Executing a wildcard search or macro in Word on a system configured with non-English regional settings.
- Observed behavior
- Wildcard search quantifiers (e.g., {1,2}) trigger an invalid pattern error because Word expects the system's regional list separator instead of a standard comma.
Check your Windows Control Panel regional settings to identify your current system list separator, as Word wildcard quantifiers rely on this specific character.
Use VBA to Retrieve the System List Separator Dynamically
Build your search pattern in VBA by programmatically fetching the correct list separator from your system settings.
Because Word ties wildcard search syntax to the system's list separator, hardcoding a comma will fail on machines with different regional settings. Using Application.International ensures the script always uses the correct character.
Press Alt + F11 to launch the Visual Basic for Applications editor in Word.
In your macro module, declare a string variable to hold the separator character by typing: Dim strSep As String.
Assign the system's list separator to the variable using the command: strSep = Application.International(wdListSeparator).
Combine the separator with your search strings. For example, instead of "htt[ps]{1,2}://", write: "htt[ps]{1" & strSep & "2}://".

Use VBA Regular Expressions (RegEx) as an Alternative
Bypass Word's native wildcard limitations entirely by utilizing the VBScript Regular Expressions engine.
Change the Windows System List Separator
Modify your Windows regional settings to use a standard comma, allowing default Word wildcard searches to function correctly.
Try WPS Office for Seamless Word Processing
If you are frustrated by complex locale-dependent errors and macro limitations in Microsoft Word, consider switching to WPS Office. It provides a lightweight, globally friendly word processing environment with excellent compatibility.

Frequently Asked Questions
Why does Word wildcard search use the list separator instead of a standard comma?
Word relies on the underlying Windows regional settings to parse lists and numeric quantifiers. In regions where the comma is used as a decimal mark, Windows assigns a different character (like a semicolon) as the list separator to prevent calculation conflicts, which unexpectedly affects Word.
What is the exact VBA code to find the system list separator?
You can retrieve the current system list separator in Word VBA using the code snippet Application.International(wdListSeparator).
Can I avoid these regional errors without writing VBA macros?
Yes, you can manually change your Windows 'List separator' in the Control Panel's Region settings to a standard comma. However, be aware that this will change how lists and CSV files are handled across all Windows applications.




