|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
regex problem
Hi, Code:
#!/usr/bin/perl -w
my $timestamp;
my $line = "Fri May 29 18:29:57.357 2009 Morocco Standard Time INFO: pid 3216 tid 1724: 170: 132192: apricocot Native Server: recvd AA_BIN_MSG_VER_CHG";
if ($line =~ /^(.*) INFO: .* recvd AA_BIN_MSG_VER_CHG/) {
$timestamp = $1;
print $timestamp;
}My regular expression the if statement is not correct, kindly help me in correcting it. Thanks NT Last edited by namishtiwari; 06-12-2009 at 10:06 AM.. |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
Code:
if ($line =~ /^(.*)INFO:.*recvd AA_BIN_MSG_VER_CHG/) { |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Regex | saikrishnan7 | Shell Programming and Scripting | 1 | 05-30-2009 08:38 PM |
| Simple regex problem? | muay_tb | Shell Programming and Scripting | 1 | 03-31-2009 09:49 PM |
| Problem with grep Regex Error | lweegp | Shell Programming and Scripting | 6 | 11-16-2006 03:04 AM |
| gcc 3.4 Regex problem | manishs13 | Solaris | 0 | 05-09-2005 03:58 AM |
| grep regex problem | iceman | Shell Programming and Scripting | 2 | 02-06-2005 11:44 AM |
|
|