That line belongs as is. It's looking for all files that do not start with a literal period.

Under Windows, the only files likely to do that are the directory aliases '.' and '..' -- and you don't really want to unlink those. Leave that line as is.

One reason your regexes in the version you posted weren't working, besides the unnecessary caret, was because you didn't have the alternation moen provided. First, you'd skip anything that didn't end it '.log'. Unfortunately, that rule excludes anything that ends in '.txt' or your date format.

In effect, the only thing left after that first rule would be '.log' files. Unfortunately, that wouldn't match the second rule, and no file would even make it to the third rule. So nothing was getting past those rules. (A file can't end in '.txt' and '.log' simultaneously.)

I hope this helps.


In reply to RE: Re: Removing files with extentions of log and date-time. by chromatic
in thread Removing files with extentions of log and date-time. by curtisb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.