The regular expression we are working with is: ^(?i).*?[_\- ]*(?:bad[-_ ]blood|smiley[_\- ]?in[_\- ]?high|smiley[_\- ]?blue[_\- ]?([^0-9_().-]+)).*?(\d*)?(\.ico)?$
Renaming Task:
Files needing renamed;
Bad-Blood-Emoji (1)1.ico
Bad-Blood-Emoji (2)2.ico
smiley_blue_eyesonfire3.ico
smiley_blue_nosepick4.ico
smiley_in_high7.ico
as you can see, there is a mix of naming styles & numbers.
GOAL (examples)
I want them renamed to something like;
Smiley-badblood(1)
Smiley-eyesonfire(2).ico
Smiley-nosepick(3).ico
and etc?...
Batch method (recommended)
-
Open the folder in Bulk Rename Utility and select those files.
-
RegEx (1) — isolate the descriptor (removes trailing digits and other noise)
- Match:
^(?i).?[_- ](?:bad[-_ ]blood|smiley[- ]?in[- ]?high|smiley[- ]?blue[- ]?([^0-9_().-]+)).?(\d)?(.ico)?$
(This is an example to show concept — you can simplify for your exact set; see notes below.)
- Replace:
\1\3
- Check Inc. Ext. only if you need to include extension in matching (not required here).
- Purpose: produce a cleaned descriptor (e.g. badblood, eyesonfire, nosepick, in_high -> inhigh or whatever normalized token you prefer).
Note: crafting a single RegEx to perfectly normalize every variant can be fiddly. If your filenames follow a few patterns, you can run multiple Match/Replace pairs (RegEx editor) to map each pattern to a clean descriptor (see examples later).
-
Case (4)
- Mode: Title (or Lower then use other rules)
- This can turn “badblood” → “Badblood” or you can instead use lower-case descriptor and keep “Smiley-” capitalized in the next step.
-
Add (7)
- Prefix: Smiley-
(This will add the fixed "Smiley-" at start.)
- Suffix: )
(we will create opening parenthesis via Numbering Sep, and closing paren here)
-
Numbering (10)
- Mode: Suffix
- Start: 1
- Incr.: 1
- Pad: 0 (or use Pad 0/none)
- Sep.: (
(Put a single "(" in Sep. so the numbering becomes "(1")
- This plus the Add(7) suffix of ")" yields filenames that end with "(1)".
-
Extension (11)
- Mode: Same (keep .ico unchanged)
-
Preview then Rename
- Select the files, click Preview (or just see the New Name column), adjust steps if something looks wrong, then click Rename.
If your RegEx isn't perfect for extracting the descriptor, you can instead use a simpler multi-step approach that’s often easier:
Simpler multi-step approach (less regex, more GUI):
A. Remove digits at end
- Remove (5) -> Chars: leave blank but enable Digits = checked
(This will remove digits from the file name portion; extension .ico remains.)
- Use Crop or Replace to remove the extraneous parentheses/numbers leftovers if needed.
B. Replace underscores and repeated words
- Replace (3)
- Replace: _
- With: (a single space or dash depending on desired output)
- Or use Replace to replace specific sequences (e.g., replace "Bad-Blood-Emoji" with "badblood").
C. Add Prefix
D. Normalize case
- Case (4) -> Title or Lower as preferred; you can then tweak exceptions.
E. Numbering
- Numbering (10) as above, Sep = "(" and Add(7) Suffix = ")"
Examples of multiple small RegEx replacements (use RegEx editor - easier than one huge regex):
- Match: (?i)bad[-_ ]blood.?(\d)
Replace: badblood
- Match: (?i)eyesonfire.?(\d)
Replace: eyesonfire
- Match: (?i)nosepick.?(\d)
Replace: nosepick
- Match: (?i)smiley[- ]in[- ]high.?(\d)
Replace: inhigh
Then run Add(7) Prefix = Smiley- and Numbering as above.
If you prefer the absolute simplest manual route (for 5 files):
- Select each file and edit the New Name column directly (click it and type the desired name) or use Rename button after filling Name (2) -> Fixed per-file. For small lists this is often quickest.
Notes & tips
- Use the RegEx editor (click the list icon) to put multiple Match/Replace rules so BRU will apply them in sequence.
- Use the Preview / New Name column constantly to check results before doing the actual rename.
- If you need descriptors all to be lower-case (e.g., badblood, eyesonfire), set Case -> Lower, then use Add(7) with Prefix "Smiley-" and Title-case the prefix if you want the leading S capitalized — easiest: put "Smiley-" as literal prefix (capital S) then set Case to Lower with Exceptions that keep "Smiley" capitalized is possible but fiddly; simpler is: Add Prefix "Smiley-" then set Case to "Same" or use formatters/tags for finer control.
- To create the parentheses around the number: Numbering Sep = "(" and Add(7) Suffix = ")" produces ...name(1).ext