Here is my problem.A existed file named data.f,I use collating symbol “48”,I want to match “48”in my file with Collating symbols in bracket expressions.
grep '[[.48.]]' data.f
but there is some error tip:
grep: Invalid collation character
but, there is no problem with character classes in bracket expressions.
grep "[[:alpha:]]" data.f
if you want to grep 48
if you want to grep “48”
// to avoid discussion in comments I extend my post with more examples
if you want to grep n occurrences of “48” in one line you should use regular expressions
basically you grep lines with at least n occurrences, and then with invert-match you exclude lines with n+1 occurrences of string, so you get n occurrences
in you comment you mentioned you wanted to grep lines with 5 occurrences of “48”, that CAN be separated by other characters (that’s the reason I put .* before “48”)
so here is the sample