From: "David Samuelsson (PAC)" <[EMAIL PROTECTED]> > i got this line in an array allready, if i do a print off the array it > prints this line. > > Last accessed 08-mar-02.10:27:55 by fdefgre.Domain > [EMAIL PROTECTED] > > what i want to do now is only pick out the date that is the > "08-mar-02" > > As it says in the manuals, one of the best with things with perl is > the abillity to use regexp, but also one of the worst/hardest things > aswell =)
I't impossible to create a proper regexp for you if we do not know how do ALL the rows you are interested in look like. If I assume all start with "Last accessed" I would suggest: $line =~ /^Last accessed (\d{1,2}-\w+-\d{1,2})/ and $date = $1; if you want to look up dates in this format in any lines: $line =~ /(\d{1,2}-\w+-\d{1,2})/ and $date = $1; actually since your dates seem to contain the leading zeroes you could use \d\d - a cipher followed by another cipher or \d{2} - two ciphers instead of \d{1,2} - one or two ciphers Jenda =========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ========== There is a reason for living. There must be. I've seen it somewhere. It's just that in the mess on my table ... and in my brain I can't find it. --- me -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]