+ Reply to Thread
Results 1 to 2 of 2

Thread: Finding URL

  1. #1
    Junior Member
    Join Date
    Jun 2012
    Posts
    10

    Finding URL

    I have some Url like :
    Code:
    http://www.google.com/search?client=safari&rls=en&q=website.org&ie=UTF-8&oe=UTF-8
    On javascript i am trying to find a domain with extension .org :
    Code:
    var checkForURL = /[\w\d](.org)/i;
    var findTheURL = checkForURL.exec(theURL);
    But the result was :
    Code:
    website.org,.org
    where did the ,.org come from ?

  2. #2
    Junior Member
    Join Date
    Jan 2012
    Posts
    22
    Change the Pattern to be :
    Code:
    var checkForURL = /[\w\d]+\.org/i;

+ Reply to Thread

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