Match any number of alphanumerics followed by a single space character : Character Class « Regular Expression « Perl






Match any number of alphanumerics followed by a single space character

    

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

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

   
    
    
    
  








Related examples in the same category

1.Character Class: Alternative Characters
2.Character Class: Anchored Characters
3.Character Class: Miscellaneous Characters
4.Character Class: Remembered Characters
5.Character Class: Repeated Characters
6.Character Class: Whitespace Characters
7.Match at least one alphanumeric followed by a single space character
8.Posix and Unicode Classes
9.The bracket metacharacters and negation
10.The bracketed character class