Skip to content
zea-favicon
Zea Knowledge Base
Zea Parts

icon picker
Using Regex for Service Part Filename Mapping

Use Regex to Map Part Numbers to CAD Files When Filenames Can’t Be Automatically Matched.

Overview

If 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.
You can see if the default regexes are creating a match at the bottom of the page.
If not, click Add Part Number Transformation (for part numbers) or Add Filename Transformation (for filenames) to create a new regex or update the default regex.
In the fields, provide:
Regex: The regex pattern (e.g., /^[A-Za-z]/i).
Operation:
Replace: Replaces matched text. Often, you remove it by leaving the replacement value empty.
Select: Keeps only the matched portion and discards everything else.
Value: The text used for the replacement if Replace is selected (empty by default).
View the updated results at the bottom of the page to confirm your regex is working correctly.
image.png
ok
Need help understanding regex? Try asking your preferred AI chatbot.
Zea uses ECMAScript syntax.

Example: Removing a Leading Letter and Extension From Filenames

Suppose your part number is 123 but the filename is A123.xyz and you want to remove both:
The leading letter (the initial A), and
The extension (the . plus letters/numbers afterward, i.e., .xyz).

Remove the Extension (Default)

Keep the default Filename Transformation regex.
Regex: /\.[0-9a-z]+$/i
Operation: Replace
Value: (empty)
This matches a literal dot . followed by one or more letters or digits up to the end of the string.
Applying this to A123.xyz transforms it to A123.

Remove the Leading Letter

Click Add Filename Transformation to create a new regex.
Input the following:
Regex: /^[A-Za-z]/i
Operation: Replace
Value: (empty)
This matches a single letter at the beginning of the string, if present.
Applying this to A123 transforms it to 123.

image.png
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.