Help! Please give me a regular expression

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
cumgie
Junior Member
Junior Member
Posts: 2
Joined: 2012-03-08, 07:18 UTC

Help! Please give me a regular expression

Post by *cumgie »

Rename below file:

25558655865 001-20111012
25558655865 001-20111016
25558655865 002-20120204
25558655865 003-20120304

Who can give me a regular expression to delete "XXX-".

Thank you!!!!!!
User avatar
MVV
Power Member
Power Member
Posts: 8713
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

If you need to remove just 001-, 002- etc, you don't even need a regex. As I see, your names have similar structure with fixed-length parts, so you can just open MRT (Ctrl+M) and use name template like [N1-12][N17-24]. You may use N[#-#] button in MRT to select parts that you need (as I did to make suggested template).
cumgie
Junior Member
Junior Member
Posts: 2
Joined: 2012-03-08, 07:18 UTC

Post by *cumgie »

OH. YOU ARE SO GREAT, It works. I dont' know [n] can use like that. COOL!

I also think out the regex: like this \s0..\-. not so smart but works also.

You way is much easy!! Thank you!! :D
User avatar
MVV
Power Member
Power Member
Posts: 8713
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

You're welcome. :)

BTW, regex would be like this: replace (\d+ )\d+-(.*) with $1$2. But direct way is much faster.

Just press F1 in MRT window and read more about possible things (some of them aren't available just from dialog, only manually).
Post Reply