Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Regexes in REN/MOVE/… commands seem to not work at all

May
24
0
We had a similar question back in August 2016; the poster concluded that a drive letter makes him happy. That doesn't work for me:

C:\tmp\tt> for %f in (1 2 3 4 5 6) do echo foo > a%f

C:\tmp\tt> dir

Volume in drive C is OS Serial number is 566b:ed1e
Directory of C:\tmp\tt\*

2017-07-08 00:24 <DIR> .
2017-07-08 00:24 <DIR> ..
2017-07-08 00:24 5 a1
2017-07-08 00:24 5 a2
2017-07-08 00:24 5 a3
2017-07-08 00:24 5 a4
2017-07-08 00:24 5 a5
2017-07-08 00:24 5 a6
30 bytes in 6 files and 2 dirs 24'576 bytes allocated
245'771'546'624 bytes free

C:\tmp\tt> ren ::a(.*) ::\1 /n
TCC: (Sys) There are no more files.
"C:\tmp\tt\::a(.*)"
0 files would be renamed

C:\tmp\tt> ren "::a(.*)" "::\1" /n
TCC: (Sys) There are no more files.
"C:\tmp\tt\::a(.*)"
0 files would be renamed

C:\tmp\tt> ren "c:\tmp\tt\::a(.*)" "::\1" /n
TCC: (Sys) There are no more files.
"C:\tmp\tt\::a(.*)"
0 files would be renamed

I seem to recall that this worked in a previous major release, 18 or 19 or so. Now I use:

TCC 21.00.31 x64 Windows 10 [Version 10.0.15063]
TCC Build 31 Windows 10 Build 15063

Thanks,
Felix.
 
Your exact syntax works here (v21); it also works without the quotes.
Code:
v:\20000files> touch /c a1 a2 a3 a4
2017-07-07 20:13:20.643  V:\20000files\a1
2017-07-07 20:13:20.643  V:\20000files\a2
2017-07-07 20:13:20.643  V:\20000files\a3
2017-07-07 20:13:20.643  V:\20000files\a4

v:\20000files> ren "::a(.*)" "::\1" /n
V:\20000files\a1 -> V:\20000files\1
V:\20000files\a2 -> V:\20000files\2
V:\20000files\a3 -> V:\20000files\3
V:\20000files\a4 -> V:\20000files\4
     4 files would be renamed
 
Your exact syntax works here (v21); it also works without the quotes.

Thanks for trying this, I appreciate it!

Maybe I am going slowly nuts. Or maybe it fails on Windows 10 in general, as opposed to Win7. Or maybe it fails on Windows 10 update 1703 — as I recall, I upgraded Windows and TCC at pretty much the same time.

If any of the esteemed readers happen to have Win10 lying around, I'd love to hear whether regex renames work on that!
 

Similar threads

Back
Top