You shouldn't match for any character (.) but for any non-r character ( [^r] ) between your wanted 'r'.
Added: Additionally you should use anchors in your regex, otherwise it will match any line, in which your regex can match 4 r, even if there are more r's in that line.
In reply to Re: extract sentences with certain number of a character
by linuxer
in thread extract sentences with certain number of a character
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |