Greetings all,
#!/usr/bin/perl use strict; use Dumpvalue; my $dumper = new Dumpvalue; my $url_string = "http://www.made_up_name.com/image.jpg there might be + text between as well since an url like so: http://www.made_up_name.c +om/image2.gif says to me this might be needed in a larger context so +lets try with a string http://www.made_up_name.com/image3_the%20third +.png and see what we get."; my @images = map{split/\//;pop @_} $url_string =~ m!(http://\S+/\S+\.[ +a-z]{3,4})!g; $dumper->dumpValues(\@images); exit; OUTPUTS: 0 ARRAY(0x155ac4c) 0 'image.jpg' 1 'image2.gif' 2 'image3_the%20third.png'

-InjunJoel
"I do not feel obliged to believe that the same God who endowed us with sense, reason and intellect has intended us to forego their use." -Galileo

In reply to Re: Regex simple quicky question :) by injunjoel
in thread Regex simple quicky question :) by tanger

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.