The greedy quantifier : Greedy « Regular Expression « Perl






The greedy quantifier

    

$string="ABCdefghiCxyzwerC YOU!";
$string=~s/.*C/HEY/;
print "$string", "\n";

   
    
    
    
  








Related examples in the same category

1.Greedy Matches
2.Greedy and non-greedy quantifiers
3.Greedy searches
4.The Greedy Metacharacters
5.Turning Off Greediness
6.A greedy quantifier
7.Shortcut Expansion Description
8.Shortcuts for Regular Expressions
9.Shortest possible match