Your update mentions this must be done in CSS selector. Well, it can't.
You are missing some of the understanding as to why contains
isn't supported. contains
is not a CSS selector and is not part of the CSS selector specification. The reason you can use it is because Sizzle implements it. Sizzle is an open source library, which is selector backing engine that jQuery uses.
So the answer is simply it cannot be done using native CSS selectors. You will either have to use XPath (Richard's answer, which, by the way, is the better way to accomplish this) or use JavaScript to execute jQuery on the page. After all, the only reason you can do it is because of Sizzle/jQuery, so you'll still have to use it somehow.
Pseudo Java below:
javascriptDriver = (JavaScriptExecutor)wd;
element = javascriptDriver.executeScript("return $(.select2-result-label:contains('"+p.getDisplayName()+"')");
(assuming that jQuery is mapped to the $
function that is, which, frankly, it should be)
XPath can do this natively, and where it needs to, Selenium will fall back to it's own implementation of XPath (open source library called Wicked Good XPath). If you are testing against modern browsers, you shouldn't have much of an issue (IE being the except).