Checking for multiple occurrences : Frequency « Regular Expression « Perl






Checking for multiple occurrences

   

Pattern     Interpretation
/a{1,4}/    Matches one, two, three, or four as.
/a{2}/      Matches two as.
/a{0,2}/    Matches one or two as.
          

   
    
    
  








Related examples in the same category

1.Check the frequency
2.Match zero or one characters
3.To specify a maximum number of occurrences, use 0 as the lower bound.
4.To specify a minimum number of occurrences, leave off the upper bound.