Match the first alphanumeric character : Index « Regular Expression « Perl






Match the first alphanumeric character

    


$p = "This is a pattern test.";

if ($p =~ /(\w)/){ print "$1\n"; }

   
    
    
    
  








Related examples in the same category

1.Back referencing
2.Backreferencing and greed
3.Backreferencing and greedy quantifiers
4.Matched index
5.$1 gets 'A', $2 gets' B'
6.Regex index