Match a substring when querying messages.