3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'foo [abc - def - ghi - jkl] bar'; $regex = <<<REGEX / (?: #start a non-capturing group \[ #match a left square brace (?=[a-z -]+]) #lookahead for the completion of a valid placeholder expression | #or \G(?!^) #continue from end position of last match and not the start of the string \s-\s #match a whitespace, hyphen then a whitespace ) #close the non-capturing group \K #forget any matched characters up to this position [a-z]+ #match one or more lowercase ascii letters /x REGEX; if (preg_match_all($regex, $text, $match)) { var_export($match[0]); }
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => 'abc', 1 => 'def', 2 => 'ghi', 3 => 'jkl', )

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:
60.27 ms | 405 KiB | 5 Q