skip to main | skip to sidebar

Harish Blog

Javascript validation for URL

function imp_isUrl(url) {
return url.match(/^(ht|f)tps?:\/\/[a-z0-9-\.]+\.[a-z]{2,4}\/?([^\s\#%”\,\{\}\\|\\\^\[\]`]+)?$/);
}

to allow #,%,[,] in url use below regular expression
return s.match(/^(ht|f)tps?:\/\/[a-z0-9-\.]+\.[a-z]{2,4}\/?([^\s”\,\{\}\\|\\\^`]+)?$/);

 

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Labels

  • Ajax (4)
  • Html (1)
  • jQuery (1)
  • Linux (5)
  • Mysql (13)
  • Netezza (1)
  • Oracle and Php (2)
  • Others (4)
  • Php (15)
  • Shell scripts (1)
  • ಟೆಕ್ news (1)

Blog Archive

  • ►  2011 (1)
    • ►  January (1)
  • ►  2010 (2)
    • ►  October (1)
    • ►  March (1)
  • ▼  2009 (11)
    • ►  December (3)
    • ▼  October (7)
      • .htaccess 301 Redirect
      • Get IP of user system
      • Javascript validation for URL
      • Zend Server talks Java, says 'no rush' for PHP 6
      • Zend Server talks Java, says 'no rush' for PHP 6
      • PHP 5.3 coming June 30th
      • Wi-fi 'to get a whole lot easier'
    • ►  February (1)
  • ►  2008 (57)
    • ►  October (7)
    • ►  September (10)
    • ►  August (6)
    • ►  July (4)
    • ►  June (4)
    • ►  May (5)
    • ►  April (11)
    • ►  March (2)
    • ►  February (7)
    • ►  January (1)
  • ►  2007 (4)
    • ►  December (3)
    • ►  March (1)
  • ►  2006 (4)
    • ►  November (1)
    • ►  October (3)