3v4l.org

run code in 300+ PHP versions simultaneously
<?php //$input = "I don't want this piece. This is the sentence I want. In don't want this piece either"; $input = "I don't want this piece! This is the <a href='https://example.com/my-sentence'>sentence</a> I want. In don't want this piece either"; $filter = "sentence"; $regex = '~\b(?:[^.?!]|https?://[^<>\s"\']++)*?'.preg_quote($filter, '~').'(?:[^.?!]|https?://[^<>\s"\']++)*~u'; if (preg_match_all($regex, $input, $match)){ print_r( array_map(function($x) {return strip_tags($x);}, $match[0]) ); }
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => This is the sentence I want )

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:
55.49 ms | 401 KiB | 8 Q