Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to Validate this URL??

How to Validate this URL??

Scheduled Pinned Locked Moved ASP.NET
javadatabasecomregexhelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    varshavmane
    wrote on last edited by
    #1

    Hello All, I need to validate http://www.pfizer.com/news/rss\_article.jsp?rssUrl=http://mediaroom.pfizer.com/portal/site/pfizer/index.jsp?ndmViewId=news\_view&newsId=20080610006500&newsLang=en URL and also http://www.pfizer.com/news/rss\_article.jsp Below is the code which I am using but it validates first one but not the second one. function ValidateURL() { var Url = "(((ht|f)tp(s?):\/\/)|(www\.[^ \[\]\(\)\n\r\t]+)|(([012]?[0-9]{1,2}\.){3}[012]?[0-9]{1,2})\/)([^ \[\]\(\),;"'<>\n\r\t]+)([^\. \[\]\(\),;"'<>\n\r\t])|(([012]?[0-9]{1,2}\.){3}[012]?[0-9]{1,2})"; var tempURL=document.getElementById("ctl00_ContentPlaceHolder1_txteventlink").value; var matchURL=tempURL.match(Url); if(matchURL==null) { alert("Web URL does not look valid"); document.getElementById("ctl00_ContentPlaceHolder1_txteventlink").value="http://"; document.getElementById("ctl00_ContentPlaceHolder1_txteventlink").focus(); return false; } } Please help me.... Thanks in advance...

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups