Renaming with a RegEx

I need to rename some files. My publishing system doesn't allow underscores. But, some software I use creates underscores when it splits PDFs into multiple files. I need to get rid of the underscores and simply replace them with the letter "p" for "page." But, the pages might have leading zeroes, and, I want to accommodate them, basically, by deleting them.

I'm trying this. These are my files.


ren ::_[0]{1,4} ::p

And, that doesn't work. I get this.

[F:\workflows\grafix\TM_PDF]ren ::_[0]{1,4} ::p
TCC: (Sys) There are no more files.
TCC: (Sys) The system cannot find the file specified.
0 files renamed

It does work when I simply have the underscore alone replaced with the "p." But, not with the regex for one or more zeroes.

May 29, 2008
Groton, CT
You probably have to quote the comma in some way. It looks like TCC is seeing ::_[0-]{1 as a file name and 4} as another file name, separated by the comma.