#1 2019-05-14 09:31

BadDogTitan
Member
Registered: 2018-12-08
Posts: 6

Remove Numbers in Brackets

I have thousands of files in the following format:

Filename 1 (A101 8.2 S3)
Filename 2 (A5 9 R14B)
Filename 3 (A45 27 M24)

How would I rename them to:

Filename 1 (S3)
Filename 2 (R14B)
Filename 3 (M24)

I know RegEx is the answer, just can't figure it out.

Thanks.

Offline

#2 2019-05-14 13:03

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 2,748

Re: Remove Numbers in Brackets

The following regular expression should do the job...

Expression: \(.*?\b([\w\d]+)\)
Replace: ($1)

Sample input:

Filename 1 (A101 8.2 S3)
Filename 2 (A5 9 R14B)
Filename 3 (A45 27 M24)
Filename 5 (TEST)

Output:

Filename 1 (S3)
Filename 2 (R14B)
Filename 3 (M24)
Filename 5 (TEST)

Offline

Board footer

Powered by FluxBB