1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

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