kaushik9918 has asked for the wisdom of the Perl Monks concerning the following question:

Hi I have a text input file :
dhs dskfsdk fsfksdfsdk { ajaj aksakj kffkfm sksk \ sndsjd sdasd sdsdsa sdasdsa sdasd sdas asd\ dsfd sdfdsf fsdfds sdfe erewr grtgw erewr} -xyz sds begin1 ... ... .. end1 begin2 .. .. end2 fd grtgrt hytht
I want to find if the words between begin1-end1 and begin2-end2 exist between { and }. Also note that sometimes, the text file might not have the character "\" and it might be only one single line , for ex..
dhs dskfsdk fsfksdfsdk { ajaj aksakj kffkfm sksk } -xyz sds begin1 ... ... .. end1 begin2 .. .. end2 fd grtgrt hytht
Please let me know a PERL subroutine to implement this. Thanks.

Replies are listed 'Best First'.
Re: matching multiple words within multiple lines in a file
by Anonymous Monk on Dec 02, 2014 at 08:59 UTC
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: matching multiple words within multiple lines in a file
by kaushik9918 (Sexton) on Dec 02, 2014 at 10:15 UTC
    Thanks @Corion!