determine whether a field is numeric, alpha or alphanumeric

Discussion in 'Perl Misc' started by shirazk, May 21, 2005.

  1. shirazk

    shirazk Guest

    is their a function or way to determine whether a field, or variable
    for that matter, is numeric, alpha or alphanumeric?
    thanks in advance
     
    shirazk, May 21, 2005
    #1
    1. Advertisements

  2. shirazk

    Anno Siegel Guest

    perldoc -q 'is a number' leads to "How do I determine whether a scalar
    is a number/whole/integer/float?". Please check the FAQ before posting.

    Anno
     
    Anno Siegel, May 21, 2005
    #2
    1. Advertisements

  3. shirazk

    Shiraz Guest

    that finds out if a scaler is a number or not. i want to see if there
    is a way to find out if its am alphanumeric, so contains both alphabets
    and numbers and maybe punctuation
     
    Shiraz, May 22, 2005
    #3
  4. shirazk

    Peter Wyzl Guest

    : that finds out if a scaler is a number or not. i want to see if there
    : is a way to find out if its am alphanumeric, so contains both alphabets
    : and numbers and maybe punctuation

    So take the answer from the FAQ, apply two grams of brain power and call
    again if your solution does not give the desired results.

    P
     
    Peter Wyzl, May 22, 2005
    #4
  5. shirazk

    Shiraz Guest

    damn this is a hostile group
     
    Shiraz, May 22, 2005
    #5

  6. Yes, there is a way.

    Use regular expressions and the match operator.

    perldoc perlrequick
    perldoc perlretut
    perldoc perlre

    perldoc -f m
    perldoc perlop


    If you post your code here, we will help you fix it.
     
    Tad McClellan, May 22, 2005
    #6

  7. No, this is a group where people are expected to expend a little
    of their own effort before asking hundreds of others to spend
    effort on their behalf.

    We help people fix Perl code, we don't generally write their
    Perl code for them.

    Take your best shot at solving your problem, and if it doesn't work,
    post your broken code here and we will help you fix it.
     
    Tad McClellan, May 22, 2005
    #7
  8. shirazk

    Shiraz Guest

    i appreciate you pointing me in the right direction....
     
    Shiraz, May 22, 2005
    #8

  9. Who pointed you in the right direction?

    Please quote some context in followups like everybody else does.
     
    Tad McClellan, May 22, 2005
    #9
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.