Quick regex help please

Discussion in 'PHP' started by pcarlow, Aug 21, 2007.

  1. #1
    Need to strip the numbers and spaces off the end of these strings:

    example 100 2 3
    data 700 example 720 53 7
    short example 14 2

    want to be left with:
    example
    data 700 example
    short example
     
    pcarlow, Aug 21, 2007 IP
  2. xdimension

    xdimension Peon

    Messages:
    180
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    preg_match_all('/^(.*?)[\s\d]*$/', $str, $matches);
    print_r($matches);
     
    xdimension, Aug 21, 2007 IP