Hi Thanks, i tried but i am getting the right output. The problem is if i am putting the same data in a file and then matching the expression it is working fine. But now my data is in a scalar variable and here the matching (m/^all:/) isnt giving me the lines starting with all:
Can someone help me with this? Regards Sudhindra On Wed, 09 Jun 2004 Tim Johnson wrote : > >perldoc perlre > >Look at the /s switch for regexes. > > > > > > > >-----Original Message----- > From: sudhindra k s [mailto:[EMAIL PROTECTED] >Sent: Wednesday, June 09, 2004 12:23 AM >To: [EMAIL PROTECTED] >Subject: Searching a string > > >Hi > >I have a string (not a file ) which looks something like this : > >tools : Abcdef >abc: >all: >def: >all: > >Now i want to search the string for all occurances of "all:" and print that line >containing "all:" > >How can this be done? > >Thanks >Sudhindra > > > > > >-- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] ><http://learn.perl.org/> <http://learn.perl.org/first-response> > >