K
Keith
All:
I am having a problem with Perl's regular expressions.
I am trying to change this --
King of the Forest Rangers S.O.S. Ranger Chapter 9.AVI
To this --
King of the Forest Rangers Ch 9 S.O.S. Ranger.avi
I tried to use this regexp but it didn't work as expected --
s/^(.*)(\s*)(.*)(\s*)(Chapter)(\s*)(\d*).AVI/$1 Ch $7 $3.avi/g
All I got was this --
King of the Forest Rangers S.O.S. Ranger Ch 9.avi
How do I make a Perl regexp that works with any number of strings at the beginning (the title of the file),
any number of strings in the middle (the title of that file's episode) and the Chapter number?
I am having a problem with Perl's regular expressions.
I am trying to change this --
King of the Forest Rangers S.O.S. Ranger Chapter 9.AVI
To this --
King of the Forest Rangers Ch 9 S.O.S. Ranger.avi
I tried to use this regexp but it didn't work as expected --
s/^(.*)(\s*)(.*)(\s*)(Chapter)(\s*)(\d*).AVI/$1 Ch $7 $3.avi/g
All I got was this --
King of the Forest Rangers S.O.S. Ranger Ch 9.avi
How do I make a Perl regexp that works with any number of strings at the beginning (the title of the file),
any number of strings in the middle (the title of that file's episode) and the Chapter number?