Regex URL

Discussion in 'PHP' started by krakiuN, Sep 30, 2012.

  1. #1
    Hi,
    I need a regex for URL that begins with http:// or https:// and mast contains .php? or. .asp? in its interior.
    Thanks.
     
    Solved! View solution.
    krakiuN, Sep 30, 2012 IP
  2. uycw

    uycw Active Member

    Messages:
    262
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #2
    uycw, Oct 3, 2012 IP
  3. HungryMinds

    HungryMinds Active Member

    Messages:
    216
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    63
    #3
    // get host name from URL
    preg_match('@^(?:http://)?([^/]+)@i', "http://www.php.net/index.html", $matches);
    $host = $matches[1];
     
    HungryMinds, Oct 3, 2012 IP
  4. plussy

    plussy Peon

    Messages:
    152
    Likes Received:
    5
    Best Answers:
    9
    Trophy Points:
    0
    #4
    plussy, Oct 3, 2012 IP
  5. krakiuN

    krakiuN Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I like your version bat i need stop extract to the first "
    how can add this ?

    thanks All for help
     
    krakiuN, Oct 4, 2012 IP
  6. Drent123

    Drent123 Peon

    Messages:
    105
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I have no idea about this syntax.
     
    Drent123, Oct 4, 2012 IP
  7. #7
    plussy, Oct 5, 2012 IP