This will work even if the filename does contain a :
character. It uses two capture groups, the first captures everything up to (but not including) the last :
character in a line (the filename) and the second capturing all digits after the last :
(the count). Input lines not matching that pattern are ignored.
$ rga ... | perl -n -E 'm/^(.*):(\d+)$/; say $1 if $2 > 10'a1.pdfa3.pdf
It won't work on filenames containing newline characters. If you need that, and rga
can be made to produce NUL-separated output (e.g. with a -0
or -z
or similar option) you could use that in combination with perl's -0
option for reading NUL-separated input.