- Jul
- 35
- 0
I'm having tough time getting regular expression matching working with IFF.
Here's the current test:
The iff in the middle doesn't ever match the filenames with ".pdf" as the extension even though there are many such files in the subdirs being tested. The files print out fine with the line above the iff, but match never occurs, so I'm guessing there is something wrong with the way I'm using the regex. The conditional expressions page in the TCC help doesn't give examples of regex use, however, so I'm not sure what to try next.
The goal is to eventually create a script that iterates through the folders on the top level and flag and move to a different location any top level folder [and all of it's contents] if one or more PDF files exist anywhere under it.
Thanks for any advice!
Here's the current test:
Code:
@echo off
DO I in (.) /A:D *
iff isdir %[I] then
pushd %[I]
DO F in /S *
iff isfile %[F] then
echo file being tested: "%[F]"
iff ("%[F]" =~ ".+\.pdf$") then
echo *********PDF: %[F]
endiff
endiff
ENDDO
popd
endiff
ENDDO
The iff in the middle doesn't ever match the filenames with ".pdf" as the extension even though there are many such files in the subdirs being tested. The files print out fine with the line above the iff, but match never occurs, so I'm guessing there is something wrong with the way I'm using the regex. The conditional expressions page in the TCC help doesn't give examples of regex use, however, so I'm not sure what to try next.
The goal is to eventually create a script that iterates through the folders on the top level and flag and move to a different location any top level folder [and all of it's contents] if one or more PDF files exist anywhere under it.
Thanks for any advice!