I don't think anyone mentioned the Find::URI module. I've never used it but I would hope it would either do a good job of this or you'd submit a patch for it based on other information in this thread. (:

I like the one Albannach mentions above except that I'd be sure to add "," to the list of punctuation marks! My limited experience with URL-matching regexen shows that the trailing comma is the number one problem for them.

I looked over the link merlyn gave and didn't see any regular expressions and was forced to actually start reading. (: The first line has a link to the regex that the discussed program generates. Somehow I cannot recommend the use of such a huge beast for the original requested purpose. Based on a very casual reading, I think that monster would actually match trailing punctation such as the period at the end of this sentence that also ends in a URL, http://www.perl.org/index.html.

        - tye (but my friends call me "Tye")

In reply to (tye)Re: Canonical regexp for urls beginning with http:// by tye
in thread Canonical regexp for urls beginning with http:// 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.