Re: [MacPerl-AnyPerl] Pattern matching: HELP!

[email protected] (Jeff Lowrey) Tue, 23 Apr 2002 07:42:03 -0500
Newsgroups perl.macperl.anyperl
Message-ID <p05010401b8eb04eeaee3@[192.168.136.5]>
At 12:59 PM -0500 4/23/02, <[email protected]> wrote:
>I'm tring to do a pattern matching on this string but after many 
>days no results.Is there someone who can help me.Many thanks
>
>Apr 21 01:03:01 pandora ipop3d[28245]: Login user=holy00

Which part of the string are you trying to match?

/ipop3d/ will match, as will /pandora/ and /Login/ and other such, 
including /01/

Are you looking to separate the string into logical sections?
Split would do that.

Or you could use something like
($mon,$time,$host,$progname,$pid,$data) = 
/(.{3})\s(\d\d:\d\d:\d\d)\s(\w{8})\s(\w*)\[(\d*)\](\w*)/;

-Jeff Lowrey