3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = 'UA-12345-1 G-J2DV45G NOPE DC-JGWWE32 AW-GER322 NAH-MATE GTM-5TDMDSZ G-WIZ'; $trackingPrefixes = ['UA', 'YT', 'MO', 'G', 'DC', 'AW']; preg_match_all( '/\b (?: (?:' . implode('|', $trackingPrefixes) . ')-[A-Z\d]{4,10}(?:-[1-9]\d{0,3})? #Tracker Ids | GTM-[A-Z\d]+ #Google Tag Manager Ids ) \b/x', $string, $m ); var_export($m[0]);
Output for rfc.property-hooks, git.master_jit, git.master
array ( 0 => 'UA-12345-1', 1 => 'G-J2DV45G', 2 => 'DC-JGWWE32', 3 => 'AW-GER322', 4 => 'GTM-5TDMDSZ', )

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:
54.05 ms | 2742 KiB | 4 Q