[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Newbie regex




Mark Bedish wrote

> I don't want these lines:
>     Date: Wed, 27 Oct 1999 05:00:21 -0700 (PDT)
> but I do want:
>     Date: Sun, 12 Dec 1999 15:20:47 -0500

  ##  Hi Mark,

  ##  the one regex you looked for might be two of them:
  ##     /Date/     &&   !/\(PDT\)/
  ##  So you can put it like this:

  ## (to havew some test lines:)
@lines = split "\n", "
oink
squeek
Date: Wed, 27 Oct 1999 05:00:21 -0700 (PDT)
Date: Sun, 12 Dec 1999 15:20:47 -0500
Date: Wed, 27 Oct 1999 05:00:21 -0700 (PDT)
Date: Sun, 12 Dec 1999 15:20:47 -0500
oink-oink
squeek";

for (@lines)  {
  if(/Date/ && !/\(PDT\)/) {
    print $_, "\n"  }  }


  ##  Detlef Lindenthal <detlef@lindenthal.com>



# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org