Sunday, August 26, 2018

Matching alphanumeric string in PERL

 
if($_ =~ /[a-zA-Z]+/ && $_ =~ /[0-9]+/)


$_ : the string in default variable
=~ : should match
a-zA-Z: lower case and uppercase
+ : more than once
&&: as well as
0-9: numbers

No comments:

Post a Comment