in reply to How to findout a sub string from the string

welcome gjoshi

peraphs you want to use a regex (regular expression) to to this kind of job.

perlrequick gives you the basic, while perlretut is a longer introduction to the matter.

Pay attention with \n newlines in your data: normally the . dot does not match them.

If you capture with (your pattern) parens then you'll have results stored into $1 ( $2 .. etc) see perlvar

In my homenode you can find some tool to play with regexes online or offline.

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^2: How to findout a sub string from the string
by AnomalousMonk (Archbishop) on Feb 13, 2016 at 19:04 UTC

    Don't forget the Holy Book itself: perlre.


    Give a man a fish:  <%-{-{-{-<