Use regular expressions to control how uploaded media is named in a specific category. This helps keep your naming consistent, structured, and easy to work with across teams and systems.
Naming matters. Whether you're dealing with product images, campaign assets, or design templates, a consistent naming convention can save hours of confusion later. By applying a naming pattern validation to a category, you make sure uploaded files follow a specific structure—automatically.
This is especially useful in workflows where filenames are used to identify product IDs, campaigns, seasons, or versioning.
Why use naming pattern validation
With this setting, QBank checks the media title (the name of the uploaded file) against a regular expression. If the name doesn't match the expected structure, the system blocks the upload and notifies the user.
You can also provide a short naming hint that appears in the upload prompt to guide users before they submit a file.
Examples of where this is useful
- Product images: Enforce naming like
productname_SP25_123456789.png
to keep files searchable and traceable. - Campaign material: Require a structure such as
brand_campaign_year_version.jpg
for organized versioning. - Multilingual assets: Enforce suffixes like
_EN
,_DE
, or_FR
to avoid miscommunication and mix-ups. - Internal documents: Require a minimum number of words or characters to ensure clarity in titles.
Example pattern: Product image naming rule
Here’s an example pattern you can use for product images:
^[\w-]+_(?:AU|SU|WI|SP)\d{2}_\d{9}\.png$
This ensures that uploaded files follow this structure:
ProductName_Season_9-digitSKU.png
-
Season must be one of:
AU
,SU
,WI
,SP
-
Year is two digits (e.g.
24
for 2024) -
SKU is exactly nine digits
-
The file must be a
.png
Example of a valid name:shoe_SP24_123456789.png
How to configure naming validation
-
Go to the Administration tab
-
Click Categories
-
Create a new category or edit an existing one
-
Scroll to the Media title pattern section
-
Paste your regular expression into the input field
-
Add a short hint to help users understand the expected structure
-
Save the category
Once active, QBank will validate all filenames uploaded to this category against the pattern.
What users will see
When uploading, users will see the naming hint before entering metadata. If a file name doesn’t match the pattern, they’ll get a clear error message and can’t proceed until it’s corrected.
Example patterns you can use
Here are some common structures and what they do:
-
/[\w &]+/
— Only allow spaces, ampersands, and word characters -
/(?:[\w]+ ){2,}[\w]+/
— Require at least three words -
/^.{20,}$/
— Require a minimum of 20 characters
Related configurations
You can combine naming validation with:
-
Accepted file types – Only allow specific file formats per category
-
Image size validation – Enforce dimension rules for uploaded images
These rules work together to create structured, purpose-driven categories that help users upload correctly from the start.
Need to create a new category first?
Validations like file type restrictions, image size limits, and naming patterns are all configured on category level. If you haven’t created your category yet, start here: How to create a category in QBank