On 6/28/07, Tom Phoenix <[EMAIL PROTECTED]> wrote:

On 6/27/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote:

> I am unable to get a generalised way in which it can extract them as few
> structures have comments, few does not hav comments etc.

Does the data have some defined grammar, or a definable one at least?



The defined Grammer here is
{
xyz1 abc1; /*Comments*/
xyz2 abc2;
xyz3 abc3[req];
xyz4 abc4[req]; /*Comments*/
};

Here, i have defined different possibility of occurences of the structure
elements. If i could get a regex for extracting xyz1, xyz2, xyz3, xyz4 and
abc1, abc2, abc3[req], abc4[req] would be helpful. Here, the comments are of
no use, i just need to ignore them.

If you are up to using Parse::RecDescent, it will probably do the job.

I am restricted from using modules and i am unable to come up with a regex
or regexes to do this job.

 >http://search.cpan.org/author/DCONWAY/Parse-RecDescent-1.94
/lib/Parse/RecDescent.pod

Hope this helps!

--Tom Phoenix
Stonehenge Perl Training

Can anyone guide me in this?

Thanks and Regards,
Dharshana

Reply via email to