in reply to Re: Etxraction of numbers in an array
in thread Extraction of numbers in an string

I understood your point, I code mostly in assembly language and have to use perl intermittently with harsh deadlines, so I accept i posted this hastily, now I have corrected my post, please have a look, sorry for inconveneince

  • Comment on Re^2: Etxraction of numbers in an array

Replies are listed 'Best First'.
Re^3: Etxraction of numbers in an array
by BrowserUk (Patriarch) on Nov 24, 2016 at 13:36 UTC

    I'd do it this way:

    #! perl -sw use strict; my $string = "<1,2>:<5,7>:<3,0>"; my @x = $string =~ m[<(\d+),(\d+)>]g; print "Extraction = @x\n"; print "1st element = $x[0]"; __END__ c:\test>junk Extraction = 1 2 5 7 3 0 1st element = 1

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
    In the absence of evidence, opinion is indistinguishable from prejudice.