- var_dump: documentation ( source)
- preg_match_all: documentation ( source)
- implode: documentation ( source)
<?php
$dictionary = array('sheet set', 'jacket', 'suit', 'oxford shoes');
$regexp = implode('|', $dictionary);
$regexp .= '|[a-z]{2,}';
$regexp = '/(?<=[^\w-]|^)('.$regexp.')(?=[^\w-]|$)/i';
var_dump($regexp);
$subject = '4-Piece 1000TC 100% Cotton Queen Sheet Set in Ivory';
preg_match_all($regexp, $subject, $matches);
var_dump($matches);