Regex Simple Question

Discussion in 'PHP' started by archgames.net, Dec 17, 2009.

  1. #1
    Hey i have a regex:
    "/<a(?:[^>]*)href=\"$findUrl\"(?:[^>]*)>(?:[^<]*)<\/a>/is"

    which works

    i want it so that after $findurl it checks for / and without /

    So http://www.google.com and http://www.google.com/ both gets matched any ideas?
     
    archgames.net, Dec 17, 2009 IP
  2. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #2
    "%<a(?:[^>]*)href=\"$findUrl/?\"(?:[^>]*)>(?:[^<]*)</a>%is"
    PHP:
    try that
     
    JAY6390, Dec 17, 2009 IP
  3. archgames.net

    archgames.net Well-Known Member

    Messages:
    532
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    120
    #3
    Thanks Jay!

    That was quick...

    It works now i guess :D
     
    archgames.net, Dec 17, 2009 IP
  4. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #4
    lol no problem
     
    JAY6390, Dec 17, 2009 IP