Use Regex to Map Part Numbers to CAD Files When Filenames Can’t Be Automatically Matched.
Overview
Zea Sync cannot automatically match filenames to the Service Part number, you can use regex (regular expressions) to create custom rules for matching part numbers to filenames. This allows you to remove extra characters or standardize text for proper matching.
How to Map Filenames to Service Parts Using Regex
Go to Zea Parts on the Zea Platform.
Click on Settings and go to the Service Part Mapping tab.
Enter the Test Part Number and Test Filename that you wish to match.
Check the bottom of the page to see if the default regex is producing a match.
If not, click Add Part Number Transformation (for part numbers) or Add Filename Transformation (for filenames) to define a custom rule.
In the fields, provide:
Regex: The regex pattern, e.g. ^.*(?=\.[^.]+$)
Operation:
Select: Keeps only the matched portion and discards everything else (default and recommended).
Replace: Replaces matched text with the value you specify (leave the value empty to remove it).
Value: Optional — used only with the Replace operation.
View the live results at the bottom of the page to confirm your regex is working correctly.
Example: The filename 123.xyz is matched to part number 123 using the default Select operation and the regex ^.*(?=\.[^.]+$), which selects everything before the file extension.
Need help understanding regex? Try asking your preferred AI chatbot.
Zea uses ECMAScript syntax.
Example: Removing a Leading Letter and the Extension
Suppose your part number is 123, but the filename is A123.xyz. You want to:
Remove the leading letter (A)
Remove the file extension (.xyz)
Use Select to Extract the Part Number
Click Add Filename Transformation.
Input the following:
Regex:^[A-Za-z](\d+)(?=\.[^.]+$)
Operation:Select
Value:(leave blank)
This selects the digits after the leading letter and before the extension.
Applying this to A123.xyz results in 123.
Example: Using ^[A-Za-z](\d+)(?=\.[^.]+$) with the Select operation extracts the part number 789 from the filename B789.sldasm, removing the leading letter and file extension.
Tip: You can test multiple filenames at once by separating them with a semicolon (;).