If u wish you can try this code

$sequence=' 1 sen 192 gube 433 siva raj 280 shank prasad 600 san zia 753'; $START1 = 1; $STOP1 = 280; $START2 = 192; $STOP2 = 433; $START3 = 600; $STOP3 = 753; for $k(1..3) { $s='START'."$k"; $en='STOP'."$k"; print "******start****"; (@arr)=$sequence=~m#$$s(.*?)$$en#gsi; $ar = join(" ", @arr); $ar=~s/\d//gi; $ar=~s/\n+/\n/gi; print "$ar"; print "******end***\n"; }


output:
******start****
sen
gube
siva
raj
******end***
******start****
gube
******end***
******start****
san
zia
******end***

In reply to Re: extracting substrings by perlsen
in thread extracting substrings by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.