Re: Regarding pattern matching

2007-05-24 Thread Dr.Ruud
"Dharshana Eswaran" schreef: > $xyz =~ /\s*(\w+)\s+(\w+);/; > $b = $2; #variable name is stored here > > ... > > But the variables like pp_lac[COMMON_TYPE_MAX] and > pp_plmn_list[COMMON_TYPE_MAX] are not getting stored because of the > special character used inbetween the names. The

Regarding pattern matching

2007-05-24 Thread Dharshana Eswaran
Hi All, I am trying to extract strings from few files. The content of the file reads as shown typedef struct { REFID_T pp_ref_id; /* destination */ CAUSE_T pp_cause;/* Reason registered */ STATE_T pp_state; /* State for indicators */ COMMON_TY

Re: Regarding pattern matching

2007-05-24 Thread Jeff Pang
Dharshana Eswaran 写道: Hi All, I am trying to extract strings from few files. The content of the file reads as shown typedef struct { REFID_T pp_ref_id; /* destination */ CAUSE_T pp_cause;/* Reason registered */ STATE_T pp_state; /* State for i

Re: Regarding pattern matching

2007-05-17 Thread Dharshana Eswaran
Of Course Rob, i always use strict and warnings... Since i had to write a pseudocode, i did not write them. But i wil lsurely keep this in mind. :-) Thank you... :-) On 5/17/07, Rob Coops <[EMAIL PROTECTED]> wrote: Sure, though I do not see why you would not want to use strict and warnings (you

Re: Regarding pattern matching

2007-05-17 Thread Matthew J. Avitable
Dharshana Eswaran wrote: 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_ME

RE: Regarding pattern matching

2007-05-17 Thread Moon, John
Subject: Regarding pattern matching 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

Re: Regarding pattern matching

2007-05-17 Thread Rob Coops
Sure, though I do not see why you would not want to use strict and warnings (you should should should or the people on this list will hunt you down and ) anyway Data::Dumper was just there for convenience: #!/usr/local/bin/perl #use strict; #use warnings; my $string = '#define MNSS_FACILIT

Re: Regarding pattern matching

2007-05-17 Thread Dharshana Eswaran
Thank you But i want to try without using any perl modules. Can you suggest some way with no modules used in that? Thanks and Regards, Dharshana On 5/17/07, Rob Coops <[EMAIL PROTECTED]> wrote: On 5/17/07, Rob Coops <[EMAIL PROTECTED]> wrote: > > How about this? > > > #!/usr/local/bin/pe

Re: Regarding pattern matching

2007-05-17 Thread Rob Coops
On 5/17/07, Rob Coops <[EMAIL PROTECTED]> wrote: How about this? #!/usr/local/bin/perl use strict; use warnings; my $string = '#define MNSS_FACILITY_IND_ID (TF_MNSS_MESSAGE_CATEGORY + 0x01) /* @LOG MNSS_MESSAGE_T */'; my @parts = $string =~ m/\s+?(\w+)\s+?\((\w+.*?)\)[EMAIL PROTECTED]

Re: Regarding pattern matching

2007-05-17 Thread Rob Coops
How about this? #!/usr/local/bin/perl use strict; use warnings; my $string = '#define MNSS_FACILITY_IND_ID (TF_MNSS_MESSAGE_CATEGORY + 0x01) /* @LOG MNSS_MESSAGE_T */'; my @parts = $string =~ m/\S+?(\w+)\s+?\((\w+.*?)\)[EMAIL PROTECTED](\w+).*/; use Data::Dumper; print Dumper @parts;

Regarding pattern matching

2007-05-17 Thread Dharshana Eswaran
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

RE: Question Regarding Pattern Matching and ARGV

2002-02-20 Thread Nikola Janceski
s "field vendno" where as before it was "field" and @ARGV[3] was "vendno" Make sense now? -Original Message- From: Nikola Janceski [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 1:04 PM To: 'Michael Pastore'; '[EMAIL PROTECTED]&#x

RE: Question Regarding Pattern Matching and ARGV

2002-02-20 Thread Nikola Janceski
sday, February 20, 2002 12:45 PM To: '[EMAIL PROTECTED]' Subject: Question Regarding Pattern Matching and ARGV > Hello All, > > This is my first posting to this Peg, please excuse any protocol ... > > I am currently working on a Perl Script and trying to do a pattern m

Question Regarding Pattern Matching and ARGV

2002-02-20 Thread Michael Pastore
> Hello All, > > This is my first posting to this Peg, please excuse any protocol ... > > I am currently working on a Perl Script and trying to do a pattern match > within an If, like: > > if ($Line =~ /field vendno/i)searching for string "field vendno" . > > but instead of hard-coding the