Assuming i have:
Mary John, Mary, Dave John, Dave, Mary
How about
$('li:contains("John"),li:contains("Mary")')