need regex help

Discussion in 'PHP' started by Develop^, Aug 22, 2009.

  1. #1
    Hi,

    Can somebody help me to find a good regex for my code? Onliy numbers, no text.

    in visualbasic, it's:

    Look: (.+?) do (.+) small (.+) big (.+)
    PHP:
    I search it in PHP.

    Thanks for helping me.
     
    Develop^, Aug 22, 2009 IP
  2. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #2
    [0-9]+ (1 or more numbers)
    [0-9]* (0 or more numbers)

    Instead of hardcoding spaces you may also want to use \s* or \s+ (captures any whitespace)
     
    premiumscripts, Aug 22, 2009 IP