Back to Blog
Advanced2025-01-2210 min read
Bulk Rename Utility Regex: Complete Pattern Guide with Examples
Bulk Rename Utility Regex: Complete Pattern Guide with Examples
Regular expressions unlock Bulk Rename Utility's full power. Here's how to master them.
Regex Basics for File Renaming
Common Patterns
. Any single character
* Zero or more of previous
+ One or more of previous
? Zero or one of previous
\d Any digit (0-9)
\w Any word character
^ Start of string
$ End of stringEssential Regex Examples
Match numbers
Pattern: \d+
Matches: 123, 4567, 89Match date format
Pattern: \d{4}-\d{2}-\d{2}
Matches: 2024-01-15Match camera prefix
Pattern: ^IMG_
Matches: IMG_1234.jpgBulk Rename Utility Regex Section
In BRU, find the RegEx section: 1. Check "RegEx" box 2. Enter Match pattern 3. Enter Replace pattern 4. Preview results
Practical Examples
Remove camera prefix
Match: ^IMG_
Replace: (empty)
Before: IMG_1234.jpg
After: 1234.jpgExtract and reformat date
Match: (\d{4})(\d{2})(\d{2})
Replace: $1-$2-$3
Before: 20240115_photo.jpg
After: 2024-01-15_photo.jpgAdd prefix keeping original
Match: ^(.*)$
Replace: vacation-$1
Before: photo.jpg
After: vacation-photo.jpgRemove spaces
Match: \s+
Replace: -
Before: my file name.jpg
After: my-file-name.jpgLowercase everything Use BRU's Case section, not regex.
Extract numbers only
Match: ^[^0-9]*(\d+)[^0-9]*(.*)$
Replace: $1$2
Before: photo_12345_final.jpg
After: 12345_final.jpgCapture Groups Explained
Parentheses create groups you can reference:
Pattern: (\d+)_(\w+)
$1 = first group (numbers)
$2 = second group (word)Example:
Match: (\d+)_(.*)
Replace: photo-$1-$2
Before: 123_vacation.jpg
After: photo-123-vacation.jpgCommon Mistakes
- Forgetting to escape: Use \. for literal period
- Greedy matching: .* matches too much, use .*?
- Case sensitivity: BRU regex is case-sensitive by default
When Regex Isn't Enough
Regex is powerful but can't understand content. For intelligent naming:
File Renamer AI uses AI to generate meaningful names without complex patterns.
Try File Renamer AI - Beyond regex.