Tokens and Patterns
Tokens
Section titled “Tokens”Think of tokens as variables for renaming—they can represent parts of the object’s name or the entire name without requiring you to type them manually. They can also reference the object’s collection name or expand into letters A-Z.
You can mix and match them to create different naming variations.
For example:
$_~1~1 #2 @
Self Token: $
Section titled “Self Token: $”$ represents the core of the object’s name, trimmed of leading/trailing non-letters and number. For example:
Self Token: $*
Section titled “Self Token: $*”$* represents the object’s full name. For example:
By using $* , you can add prefix and suffix to the name like so
Collection Token: ;;
Section titled “Collection Token: ;;”;; represents each object’s collection name.
Word Token: ~n, ~~n, ~~-n
Section titled “Word Token: ~n, ~~n, ~~-n”Note: n == integer number
~1 refers to the first word of the object’s name.
~~1 refers to the first word of the object’s name + its trailing separators
~~-1 refers to the last word of the object’s name + its leading separators
The double tilde (~~) removes the word along with its trailing separator.
Using a negatif number lets you select words from the end of the name and targets the leading separator instead of the trailing one.
Number Token: #n, ##n, ##-n
Section titled “Number Token: #n, ##n, ##-n”Note: n == integer number
#1 refers to the first number of the object’s name.
##1 refers to the first number of the object’s name + its trailing separators
##-1 refers to the last number of the object’s name + its leading separators
The double pound (##) removes the number along with its trailing separator.
Using a negatif number lets you select numbers from the end of the name and targets the leading separator instead of the trailing one.
Regular Expressions
Section titled “Regular Expressions”When tokens aren’t enough for complex naming tasks, you can use regular expressions (regex) to target specific patterns in object names.
- Wrap your regex pattern in curly brackets
{ }. - Text inside the brackets is treated as a regular expression.
- Use parentheses
( )to capture specific parts of the name.
v) at the end of the string after an underscore.
Tip: Regular expressions offer great flexibility but require some familiarity with regex syntax.
Need help crafting patterns? Try tools like regex101.com for testing and quick explanations.
Fallback value
Section titled “Fallback value”If the regular expression doesn’t find a match, instead of returning an empty string (""), you can specify a fallback value using the /or:replacement_text/ syntax. Place this at the end of the expression.
For example: