Before anyone says anything I have looked through the monastary looking for code that already does what the title describes. I know about here, which has been useful, but does not work under my circumstances.

Please hear me out first.

I have put assigned to put together an html version of a PDF document. Why? I do not know, but the PDF document is too comples to just directly save as html. Anyways, I have put the document together into html, but alot of the URLs that are written in the text are not html clickable links.

I have tried the solutions at here, but they yield results to be questioned. You see the URLs in the document are not directly formatted to any specification -- meaning they are directly written into a sentence as if it were a word.

For example:

Students can activate their UMSIS userids on-line by filling out and submitting the form at https://umsis.miami.edu/sign-up.
...which can be obtained via the web at http://www.miami.edu/it-forms/.

Do you noticed the period at the end? Well all the solutions that I have for convert http:// into links do not account for this problem. I am trying to account for grammatical puncutation that a URL might encounter, but have not been able to come with a solution.

I was wondering if the community had any insight? I have never been really good as regexp, so forgive my ingonorance if this really easy.

Update

I just noticed also that the documents contain email address. In the same situation with http links with the whole being represented as a word not as a URL. If you can help with that... you would save me a lot of time. Considering the document if a few hundred pages.

Thank you


In reply to replace url in text with html link by thealienz1

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.