in reply to Re: extract sentences with certain number of a character
in thread extract sentences with certain number of a character

If I remember correctly (perldoc perlop):

tr/// does not support character classes, so tr/[r|R]// does count any of the characters [, r, |, R and ].

And character classes don't need | for the alternatives; so [rR] would be enough for a class matching r and R.

tr/rR// should be enough to count the occurences of r's and R's.

  • Comment on Re^2: extract sentences with certain number of a character