Yes, it's a serialized array. It may be possible to come up with a regular expression that would let you check using sql, but the easier way to do it would be to read all the records, use unserialize to make an array, then search the array. Unfortunately, you need to read all the rows from that table to do it that way.
Depending on what you're doing, you may want to use the pm table. Then you could do something like:
Code:
$check = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "pmtext as pmtext
LEFT JOIN ".TABLE_PREFIX."pm AS pm ON(pm.pmtextid=pmtext.pmtextid)
WHERE pm.userid NOT IN ( 2,4,5 ) ");
Edit: actually I'm not sure about that query since I haven't tested it.
Edit again...also, I guess that will only work for finding users who haven't deleted the pm already.