Welcome!

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

SignUp Now!

Regular expression FOR/DIR

Jun
223
0
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
 
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
 
Thanks for your answer Peter! This solves it.

@rconn

Please update the documentation under "Wildcards and Regular Expressions". The example at the very bottom reads

dir ::"^\w{1,8}\.btm$"
nickles
 

Similar threads

Back
Top