Can some one please tell me how to get the values after the third piping (|) symbol without the plus signs

$data = '[-3|1|29x250+46+26|200+300+464|Get][-3|1|29x250+46+26|132+100 ++244|come][-3|1|29x250+46+26|220+124+432|Go][...][...]' I need the output as $val1 = 200 $val2 = 300 $val3 = 464 etc.,
This is what i have tried
my $data = '[-3|1|29x250+46+26|200+300+444|Get][-3|1|29x250+46+26|200+ +300+444|Get][-3|1|29x250+46+26|200+300+444|Get]'; my $REGEX_COLLECTION = '(\[.*?\])'; my $REGEX_TEXT_RESPONSE = '\[(.*?)\|(.*?)\|(\d+)x(\d+)\+(\d+)\+(\d+)\| +(\d+)\+(\d+)\+(\d+)|(.*?)\]'; my @splits = split( $REGEX_COLLECTION, $data ); foreach (@splits) { print "The split value is $_ \n"; if ( $_ =~ m/$REGEX_TEXT_RESPONSE/g ) { print "The first split is $1 \n"; print "The second split is $2 \n"; print "The tird split is $3 \n"; print "The fourth split is $4 \n"; print "The fifth split is $5 \n"; print "The sixth split is $6 \n"; print "The seven split is $7 \n"; print "The eight split is $8 \n"; print "The nine split is $9 \n"; print "The tenth split is $10 \n" } }
I am getting the output as

The split value is The split value is [-3|1|29x250+46+26|200+300+444|Get] The first split is -3 The second split is 1 The tird split is 29 The fourth split is 250 The fifth split is 46 The sixth split is 26 The seven split is 200 The eight split is 300 The nine split is 444 The tenth split is The split value is The split value is [-3|1|29x250+46+26|200+300+444|Get] The first split is -3 The second split is 1 The tird split is 29 The fourth split is 250 The fifth split is 46 The sixth split is 26 The seven split is 200 The eight split is 300 The nine split is 444 The tenth split is The split value is The split value is [-3|1|29x250+46+26|200+300+444|Get] The first split is -3 The second split is 1 The tird split is 29 The fourth split is 250 The fifth split is 46 The sixth split is 26 The seven split is 200 The eight split is 300 The nine split is 444 The tenth split is

I am not getting the values of Get. Is there another way to do this. Is this the best way. Please suggest.


In reply to Perl Regex by Buddyhelp

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.