Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

help in converting relative links to absulote links

Last post 02-08-2010, 1:10 PM by Sergei Z. 1 replies.
Sort Posts: Previous Next
  •  02-06-2010, 3:27 PM 59346

    help in converting relative links to absulote links

    hello guys

    i trying tofind all relative links on page and change them to absoulote links.

    example finding all href or img src links that dont start with http:// and add to them the domain

    so if i have about.htm it will be http://domain.com/about.htm

    i want to do it for all tags that use relative links i manage to do it for img and href but its not perfect

    i used: (<\s*(a|img)\s+[^>]*(href|src)\s*=\s*[\"'])(?!http)([^\"'>]+)[\"'>]

    but it show me the <a href= tag and <img src= tag and i need only the relative link

    i need it for my c sharp application

    if someone can help me find the solution it will be great

    because i'm working of it almost a week and can find how to do it

     thanks in advance

  •  02-08-2010, 1:10 PM 59417 in reply to 59346

    Re: help in converting relative links to absulote links

    pls provide some real text you are working with, th
View as RSS news feed in XML