in reply to Re^3: alpha numeric comparision
in thread alpha numeric comparision
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.
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.
|
|---|