help for regex pattern

Discussion in 'Programming' started by roxcon, May 31, 2011.

  1. #1
    please help me to match this pattern using regular expression
    
    [from :http://www.webaddress.com]
    PHP:
    • above pattern the bracket can be ( or { or [ or <
    • after bracket first character can be null or space or . or ,
    • then From
    • then : and after this character should be space
    • then URL
    • then again space and one or these characters null or space or . or ,
    • then close bracket can be ) or } or ] or >

     
    roxcon, May 31, 2011 IP
  2. tothemax

    tothemax Peon

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try [\[{(]from[\s\.,]??:(http.+?)[\s\.,]??[\])>]
    This will give you the URL as the first matching group
     
    tothemax, Jun 6, 2011 IP