in reply to Re: alpha numeric comparision
in thread alpha numeric comparision

There is no clue there as to what you are trying to achieve.

Replies are listed 'Best First'.
Re^3: alpha numeric comparision
by prad_intel (Monk) on Jan 28, 2005 at 13:28 UTC
    I have 3 variables,I want to compare those 3 based on a particular logic

    All i want now is the variables are alpha numeric, i tried regex but i am unable to achieve the above

    Hope i get a guiding light.

    Prad
      This doesn't help. Post some examples of values for the variables, and what the results of the 'comparison' would be.
      I have 3 variables,I want to compare those 3 based on a particular logic All i want now is the variables are alpha numeric, i tried regex but i am unable to achieve the above

      Your problem has nothing to do with Perl. You are trying to implement "a particular logic" in Perl but you are unable to describe that "particular logic" even in human language.

      You are making the common mistake of jumping ahead to how without first pausing at what.


      Hmm... I've just re-read what you said...
      All i want now is the variables are alpha numeric

      ...is that really all you are asking?

      To check that a string is alphanumeric with a regex

      !/[^[:alnum:]]/

      or if you don't want a negated regex

      /^[[:alnum:]]*\z/

      Note: only pedants use \z most of the time. Most people use $. Reading the manual to discover the subtle difference is left as an exercise for the reader.