3v4l.org

run code in 300+ PHP versions simultaneously
<?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);
Output for git.master, git.master_jit, rfc.property-hooks
string(74) "/(?<=[^\w-]|^)(sheet set|jacket|suit|oxford shoes|[a-z]{2,})(?=[^\w-]|$)/i" array(2) { [0]=> array(5) { [0]=> string(6) "Cotton" [1]=> string(5) "Queen" [2]=> string(9) "Sheet Set" [3]=> string(2) "in" [4]=> string(5) "Ivory" } [1]=> array(5) { [0]=> string(6) "Cotton" [1]=> string(5) "Queen" [2]=> string(9) "Sheet Set" [3]=> string(2) "in" [4]=> string(5) "Ivory" } }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
139.27 ms | 406 KiB | 5 Q