in reply to Regex Help!

Take a look at perlre: Modifiers:

-- Ken

Replies are listed 'Best First'.
Re^2: Regex Help!
by Anonymous Monk on Sep 19, 2013 at 08:11 UTC

    Thanks. I tried this, got the second one, but still unable to get the 3rd one!..

    my $loc = $1 if ($loc_data =~ /.+Location:(.*)/);

    what if there is more than 3 Location: in the $loc_data? Is there a way we can define it by the number? means we define 1 and we get the first? if its 2 we get 2nd, like that!

      Where do you use the g and m modifiers?
        I tried many changes, but failed each time!!!