The classic mail command does not accept flags in "message list" so you can only specify number or ranges of numbers. However on my system I have mailx and it accepts expressions like
? d :n # to delete all new messages
? d :u # to delete all unread messages
and so on. An excerpt from the manual page:
The following special message names exist:
:n All new messages.
: o All old messages (any not in state read or new).
:u All unread messages.
:d All deleted messages (for the undelete command).
:r All read messages.
:f All `flagged' messages.
:a All answered messages (cf. the markanswered variable).
:t All messages marked as draft.
:k All `killed' messages.
:j All messages classified as junk.
I hope this helps.