Re: Simple regex problem has me baffled

2009-01-27 Thread Gunnar Hjalmarsson
Bill Harpley wrote: Hi Gunnar, I tried your suggestions but had no luck :-( (1) I tried your idea of using a paragraph separator local $/ = ''; # paragraph mode while ( my $entry = ) { if ( $entry =~ /\[([a-z0-9]{5})]/ ) { print "$1\n";

RE: Simple regex problem has me baffled

2009-01-27 Thread Bill Harpley
Can you explain why this works but my orginal effort did not? Many thanks, Bill Harpley -Original Message- From: Rob Dixon [mailto:rob.di...@gmx.com] Sent: Monday, January 26, 2009 7:19 PM To: Perl Beginners Cc: Bill Harpley Subject: Re: Simple regex problem has me baffled Bill Harple

RE: Simple regex problem has me baffled

2009-01-27 Thread Bill Harpley
each record into a single long line before trying to perform regex match? Is there an easy way to do this? Regards, Bill Harpley -Original Message- From: Gunnar Hjalmarsson [mailto:nore...@gunnar.cc] Sent: Monday, January 26, 2009 5:22 PM To: beginners@perl.org Subject: Re: Simple re

RE: Simple regex problem has me baffled

2009-01-27 Thread Bill Harpley
it:]] but to no avail So I remain stuck at square one !! Regards, Bill -Original Message- From: John W. Krahn [mailto:jwkr...@shaw.ca] Sent: Monday, January 26, 2009 5:20 PM To: Perl Beginners Subject: Re: Simple regex problem has me baffled Bill Harpley wrote: > Hello, He

RE: Simple regex problem has me baffled

2009-01-27 Thread Bill Harpley
uch as 'print "$1\n";' in other scripts. Regards, Bill Harpley -Original Message- From: Mr. Shawn H. Corey [mailto:shawnhco...@magma.ca] Sent: Monday, January 26, 2009 4:32 PM To: Bill Harpley Cc: beginners@perl.org Subject: Re: Simple regex problem has

Re: Simple regex problem has me baffled

2009-01-26 Thread Rob Dixon
Bill Harpley wrote: > Hello, > > I have simple regex problem that is driving me crazy. > > I am writing a script to analyse a log file. It contains Java related > information about requests and responses. > > Each pair of Request (REQ) and Response (RES) calls have a unique > Request ID. This is

Re: Simple regex problem has me baffled

2009-01-26 Thread Gunnar Hjalmarsson
Bill Harpley wrote: [2009-01-23 09:20:48,719]TRACE [server-1] [http-80-5] a...@mydomain.net :090123-092048567:f5825 (SetCallForwardStatusImpl.java:call:54) - RequestId [81e80] SetCallForwardStatus.REQ { accountNumber:=W12345, phoneNumber:=12121212121, onBusyStatus:=true, busyCurrent:=voicemail,

Re: Simple regex problem has me baffled

2009-01-26 Thread John W. Krahn
Bill Harpley wrote: Hello, Hello, I have simple regex problem that is driving me crazy. I am writing a script to analyse a log file. It contains Java related information about requests and responses. Each pair of Request (REQ) and Response (RES) calls have a unique Request ID. This is a 5 d

Re: Simple regex problem has me baffled

2009-01-26 Thread Mr. Shawn H. Corey
On Mon, 2009-01-26 at 16:20 +0100, Bill Harpley wrote: > foreach $entry(@list) > { > > $entry =~ /\[([a-z0-9]{5})\]/; > > print "$1\n"; # print to screen > > # print FILE "$1\n";# print to file > } If there is no match, you are printing a uninitiali

Simple regex problem has me baffled

2009-01-26 Thread Bill Harpley
Hello, I have simple regex problem that is driving me crazy. I am writing a script to analyse a log file. It contains Java related information about requests and responses. Each pair of Request (REQ) and Response (RES) calls have a unique Request ID. This is a 5 digit hex number contained in squ