#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2000
    Posts
    0
    Rep Power
    0
    I'm really weak with regular expressions, and need to write one that handles a variable number of digits.

    Here's part of a message that I receive:

    name="Key" value="1069632612"> ');

    The value may have more or less digits. When I originally wrote an expression, I did it cheap and dirty with this:

    /name="Key" value="(dddddddddd)/i

    but of course it broke a short while later when I received a shorter key value.

    Can someone help me out with this?

    Thanks!
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    2
    Rep Power
    0
    Try using something like this

    ([0-9]*)

    or specifying the lower and upper limits of the number of digits

    ([0-9]{3,6})

    Oh and RTFM.

IMN logo majestic logo threadwatch logo seochat tools logo