RegExp search

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
LarsSandberg
Junior Member
Junior Member
Posts: 62
Joined: 2003-04-11, 07:46 UTC
Location: Denmark

RegExp search

Post by *LarsSandberg »

Hi, i'm using TC 6.02. I need to do a file search, where exactly 4 digits forming a number from 0001 to 9999 is a part of the filename.

So the filenames is as follows:
somecharacters.####.iam

For the "somecharacters" part, this can be a name with letters and or digits, then "dot" followed by the 4 digits (for version number) folowed by the extension ".iam"
The files er oldversion files generated from our CAD system, they are like a huge amount of bak-files which I wan't to delete periodically.

I looked into RegExp, but didn't find the appropriate syntax

regards Lars
Best regards
Lars
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

Try this with regex:on

Code: Select all

.+\.\d{4}\.iam
it means

Code: Select all

.+
any char at least one time

Code: Select all

\.
just a dot - the '\' makes the dot mean a dot and not any char

Code: Select all

\d
a digit

Code: Select all

{4}
the last char 4 times (so 4 digits)

Code: Select all

\.iam
just another dot followed by iam

sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
Post Reply