Using Regular Expressions (Regex) to Automate Derivative Creation

Summary

In Bynder, you can use regex to control when a specific custom image derivative is automatically created. This is useful when you want to ensure only specific files trigger a transformation process, for example, generating a "Watermarked" derivative only for files with "Public" in the filename, while files without it skip that processing step.

What is regex? Regex (short for Regular Expressions) is an automated way to search for and identify specific patterns in text, similar to a "Find" tool, but it can match structures (for example, all filenames starting with "2026_") instead of a single fixed word.

Who?

  • Bynder Admins enter the regex pattern in the designated field when configuring a custom derivative in the portal.
  • Regular users are not required to interact with regex directly; the rule applies automatically whenever a matching file is uploaded.

Why?

  • Precision: Automation applies specific derivative settings only to the files that actually need them.
  • Efficiency: Files that don't match the pattern skip unnecessary processing, keeping your workflow clean.
  • Storage management: Avoiding unnecessary derivative generation helps keep portal storage organized, since all derivatives count toward your storage limit.

How?

  1. Open the custom derivative configuration for the derivative you want to control in your Bynder portal (Admin access required).
  2. Enter a regular expression pattern in the designated regex field.
  3. Save the configuration. From that point on, the derivative will only be generated for files whose filenames match the pattern.

Example regex patterns

  • ^2026: The caret (^) anchors the match to the start of the filename. Matches "2026_ProjectA.jpg" but not "Report_2026.pdf."
  • \.png$: The dollar sign ($) anchors the match to the end of the filename. Matches any file ending in ".png."
  • .*_Icon: The .* wildcard matches any characters. Matches any filename ending in "_Icon," such as "Web_Icon," "Print_Icon," or "Social_Icon."

Uploader behavior

  • Mass Uploader: The asset's filename must start with the specified regex for the derivative to be created.
  • Standard uploader: This start-of-filename requirement does not apply.

Related Articles

Updated