.* special-character combination tries to match as much as possible : Metacharacters « Regular Expression « Perl






.* special-character combination tries to match as much as possible

    

if the string banana is searched using the following pattern, the pattern 
matches banana, not ba or bana: 
/b.*a/ 

The .* character only matches the longest possible string that enables the pattern match as a whole to succeed. 

   
    
    
    
  








Related examples in the same category

1.Meta-Character ASCII Values
2.Meta-Characters listing
3.Metacharacters and metasymbols
4.Metacharacters for Single Characters
5.Metacharacters that Turn off Greediness
6.The dot metacharacter
7.The dot metacharacter and the zero or more quantifier
8.Some Regular Expression Metacharacters