You are not logged in.

#1 2014-11-06 00:06:57

Ploppz
Member
Registered: 2013-09-14
Posts: 313

(regex) Need help figuring out why this perl-rename test doesn't work.

I'm testing out perl-rename, renaming files using regex.

I named a file "f30e" and as a test I want to just find the number and place it first:

perl-rename 's/\(.*\)\([0-9][0-9]\)\(.*\)/\2\1\3/g' *

Expected result is 30fe. Actual result: It stays the same.

I need this because I need to isolate and rearrange certain pieces of information in the file names.

Thanks.

Offline

#2 2014-11-06 00:25:07

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: (regex) Need help figuring out why this perl-rename test doesn't work.

If you want to use perl-rename, you have to use perl regex. Get rid of your escapes for the parenthesis.

Offline

#3 2014-11-06 07:01:29

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,532

Re: (regex) Need help figuring out why this perl-rename test doesn't work.


do it good first, it will be faster than do it twice the saint wink

Offline

Board footer

Powered by FluxBB