Keep part of the file name

A swapping-ground for Regular Expression syntax

Keep part of the file name

Postby ronyshawkat » Wed Jun 14, 2017 11:21 am

Hi,

I have some files which looks like this

F_Personal_UP_Job_102_Balustrade_Balustrade Model_100617_Library_Balustrade_PlotFiles_Prototypes_Single Part_TP401-V22-BP2 A3 Advance Steel
F_Personal_UP_Job_102_Balustrade_Balustrade Model_100617_Library_Balustrade_PlotFiles_Prototypes_Single Part_TP401-V22-p2 A3 Advance Steel

I just want to keep the Bolded parts of the file name and want them to look like this

TP401-V22-BP2
TP401-V22-p2

Is it possible to do?
ronyshawkat
 
Posts: 3
Joined: Thu Feb 18, 2016 5:06 pm

Re: Keep part of the file name

Postby KenP » Wed Jun 14, 2017 12:03 pm

Try this.

RegEx (1)
Match: _(\w*-\w*-\w*).*$
Replace: \1
KenP
 
Posts: 199
Joined: Sat Jul 30, 2016 11:25 am

Re: Keep part of the file name

Postby cbanzet » Tue Jun 20, 2017 6:56 pm

Nice job KenP. You make it look easy.
cbanzet
 
Posts: 3
Joined: Tue Jun 20, 2017 6:53 pm


Return to Regular Expressions