Regex help needed

Discussion in 'Programming' started by Sushi_Master, Jul 12, 2009.

  1. #1
    I need help with some regex to help me extract strings from some HTML.

    Example, I need to extract the date from a title which changes on a regular basis...

    12 July 09 We went to the beach!

    I need to pick up the date red, no matter what the date or the text to the right of it.

    Is there a simple way to do this?
     
    Sushi_Master, Jul 12, 2009 IP
  2. ThePHPMaster

    ThePHPMaster Well-Known Member

    Messages:
    737
    Likes Received:
    52
    Best Answers:
    33
    Trophy Points:
    150
    #2
    
    preg_match_all('/([0-9]{2} [a-zA-Z]{0,9} [0-9]{2})/Usmi',$textSearched,$results);
    print_r($results);
    
    PHP:
    I didn't test it, but it should be something like it.
     
    ThePHPMaster, Jul 12, 2009 IP