SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jan 2007
    Location
    Copenhagen, Denmark
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Automatic url replace with exceptions

    Hi,

    I'm wondering if anyone can help me on this one

    I have a full text string where I want to automatically replace typed urls with actual html links. My problem is that strings sometimes will have code for embedding videos from youtube and the likes which include urls.

    How do I replace urls with links while keeping embedded videos intact?

  2. #2
    SitePoint Zealot
    Join Date
    Jan 2006
    Posts
    130
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just make sure there are spaces

    like an embed has:
    "http://bla.com"

    make a regex that looks for a link and surrounding spaces \s
    TinyURL can suck a W33 Peen


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •