develooper Front page | perl.beginners | Postings from May 2007

Regarding pattern matching

Thread Next
From:
Dharshana Eswaran
Date:
May 17, 2007 04:13
Subject:
Regarding pattern matching
Message ID:
9f91e0840705170412j594f91dds1847844a72f44797@mail.gmail.com
Hi All,

I am trying to extract few strings from a text file. The pattern of the text
stored in the file is as follows:

#define MNSS_FACILITY_IND_ID       (TF_MNSS_MESSAGE_CATEGORY + 0x01) /* @LOG
MNSS_MESSAGE_T */


I need to extract MNSS_FACILITY_IND_ID, TF_MNSS_MESSAGE_CATEGORY + 0x01 and
MNSS_MESSAGE_T.

I tried

next unless /#define\s+(\w+)\s+\(([^)]+)\s+\/\*\s+@LOG\s+(\w+)\*\//;

 my $name = $1;
my ($base, $offset) = $2 =~ /\w+/g;
my $Struct = $3;

I am unable to find out the error.

Can anyone help m in this?

Thanks and Regards,
Dharshana

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About