Thread: Not integer

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2009
    Posts
    29
    Rep Power
    0

    Not integer


    I need to match any string that contains at least one non digit at any place:

    should match:
    10321foo12bar
    foo1bar1123
    foobar


    shouldn't match:
    1
    10
    2023


    I successfully matched a string that contains at least one non digit but it doesn't work for following example:

    320.3t foo bar (blah)
    while it matches:
    3203t foo bar (blah)

    here is my regex:
    Code:
    \d*(?=\D)(?=\w).*?
    What am I doing wrong?

    P.S.
    This is just a part of my whole regex, it's basically one backreference so I can't use ^...$, can I?
  2. #2
  3. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,247
    Rep Power
    9400
    Normally I'd say
    Code:
    \D
    but if it's part of a regex then you may need something more like
    Code:
    \d*\D
    but then I wonder, what exactly does "just a part" mean?

IMN logo majestic logo threadwatch logo seochat tools logo