Using Bulk Rename

A swapping-ground for Regular Expression syntax

Using Bulk Rename

Postby etaulton » Sat Apr 04, 2020 7:51 pm

I have a group of files that start like the examples......
SUAGP-AM_321Z2DE_0CR8JQHPF00VGKY_1640706829........
SUAUS-AD_321Z2D5_0CR8JEHPF0066H4_1639352245.......
SUAUS-AD_321Z2D8_0CR8JEHPF009YW8_1845592362......

I am trying to create a rule to replace the SECOND underscore with a $ and leave the others. Is this something I can do with Regular Expression Match/Replace or is there another option in the application to do this?
etaulton
 
Posts: 1
Joined: Sat Apr 04, 2020 7:45 pm

Re: Using Bulk Rename

Postby RegexNinja » Sat Apr 04, 2020 11:55 pm

Hi.. Regex is best suited for that:

#1Regex Match/Replace
^(.*?_.*?)_(.*)
\1$\2

Results:
Suaus_321Z_A_B_C_D ----> Suaus_321Z$A_B_C_D
RegexNinja
 
Posts: 134
Joined: Fri Feb 21, 2020 5:26 pm


Return to Regular Expressions