New to regex: filename ending with caret + digits

A swapping-ground for Regular Expression syntax

New to regex: filename ending with caret + digits

Postby raywood » Tue May 31, 2022 8:02 pm

I have files with names like this:

Long file name^1325.eml


I want to rename them to look like this:

Long file name^.eml


After playing with the results, I may want to eliminate that ending caret as well.

I've tried variations on this:

Code: Select all
\d{1,6}\.eml$


but BRU is not signaling any recognition when I enter that in the RegEx Match box.

What am I doing wrong?
raywood
 
Posts: 5
Joined: Wed Oct 20, 2010 3:56 pm

Re: New to regex: filename ending with caret + digits

Postby Luuk » Tue May 31, 2022 11:55 pm

With a checkmark inside for "Inc.Ext", the "Match" and "Replace" can be like...
(.+\^)\d{1,6}\.eml$
\1
Luuk
 
Posts: 691
Joined: Fri Feb 21, 2020 10:58 pm


Return to Regular Expressions