When you perform a /filter, the identifier $filtered will return the number of filtered lines.

So after you issue your filter command, you check for:

if ($filtered) {
; matches were found
}
else {
; nothing was found
}

EDIT: fixed typo