Regular expression FOR/DIR

Jun 24, 2008
223
0
Siegen, Germany
Found the following inconsistency:

Code:
> 20110707_algol.dat
dir ::"^201\d{5,5}.*.dat$"
rem shows the file
for %i in (::"^201\d{5,5}.*.dat$") echo %i
rem doesn't show the file
I additionaly tried /f and /w switches - to no avail. Am I doing sth wrong?

nickles
 
Jul 1, 2008
81
0
76
Montreal
Found the following inconsistency:

Code:
> 20110707_algol.dat
dir ::"^201\d{5,5}.*.dat$"
rem shows the file
for %i in (::"^201\d{5,5}.*.dat$") echo %i
rem doesn't show the file
I additionaly tried /f and /w switches - to no avail. Am I doing sth wrong?

nickles

Putting the double-colon inside the double-quotes got the expression working for me:
Code:
> for /w z in ("::^201\d{5,5}.*.dat$") dir %z
C:\tmp\20110707_algol.dat
C:\tmp\20110708_algol.dat
C:\tmp\20110709_algol.dat
C:\tmp\20110710_algol.dat
This syntax works with TCC Regular Expression Syntax configured for PERL, Ruby, Java, or GNU, but not grep or POSIX.

HTH
--
Peter
 

Similar threads