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
74
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
Thread starter Title Forum Replies Date
D How to? Use regular expression with REN? Support 2
R v25 Regular Expression Analyser Support 2
rps Documentation Regular expression syntax link broken Support 1
M How to? Do a particular regular expression... Support 8
JohnQSmith Regular expression groups Support 15
A How to? filter text stream with a regular expression Support 11
Phileosophos Can FFIND match file names with a regular expression? Support 19
fpefpe regular expression -- caseless Support 3
Jesse Heines Using Regular Expressions with the REN commanc Support 8
mikea How to? Regular expressions in TCC Support 6
vefatica FFIND and multi-line regular expressions Support 4
vefatica Regular expressions? Support 12
T FOR command and regular expressions Support 19
Steve Pitts How to? FFIND, regular expressions and double quotes Support 4
vefatica Regular expressions in FOR's set? Support 10
vefatica DIR and regular expressions Support 0
T DEL disregards switch when using regular expressions Support 2
C searching history and regular expressions Support 5
vefatica SET /A var=expression=digits Support 3
D conditional expression: force numeric Support 6
D Catching the result of an evaluated script expression Support 0
WadeHatler Fixed Breaking change in Expression evaluation (.and.) in v17 Support 6
Joe Caverly Conditional Expression Test of @SFN Support 4
cgunhouse Trouble with Relational Expression Support 4
M Just a verification regarding "Iff" and both "status test(s)" and "relational expression(s)"... Support 3
B @PERL[expression] definition? Support 2
E Fixed Bug with DIR /Z displaying descriptions Support 8
J Paths shown in DIR /B Support 2
K Fixed Prompt display will be shifted after use dir to display a filename with Chinese. (v25.00.28 x64) Support 18
Jesse Heines How to? How to display picture creation date with dir command Support 6
vefatica WAD DIR.BTM? Support 11
DrusTheAxe DIR reports meaningless SYMLINK information Support 14
C show file description? with dir? Support 8
vefatica DIR /F and streams? Support 7
rps Multi-column DIR /v not displaying all files. Support 5
R How to? Dir specific file search patterns with spaces in the pathnames? Support 6
rps Dir /Nfv -> Alt-F2 Support 2
rps @FILESIZE[....,a] allocated size not matching Dir results Support 8
A TCMD - Dir Command puts out blank lines? Support 16
S Problems with dir command in the debugger Support 5
M TCC incorrect dir output since Windows 1803 Support 6
x13 Problem listing repository files using DIR http(s)://... Support 8
cxxl dir /s works in mysterious ways :( Support 4
vefatica Help nit (FFIND and DIR with /S) Support 0
N Fixed Strange dir behavior Support 6
JohnQSmith Weird DIR output (missing lines) Support 1
C 7zip with date range .vs. filelist created with dir and daterange Support 0
D Towards shared (dir-)history lists Support 3
vefatica WAD DIR /HL still gets names wrong Support 16
vefatica DIR /S /HL? Support 4

Similar threads