3v4l.org

run code in 300+ PHP versions simultaneously
<?php $haystack = 'There are stores attached: Store1 (Detached) **28876.Mazon** (Detached) 28455.Targo (Detached) 28389.Walmo (Detached)'; foreach (['Mazon', 'Targo', 'Walmo', 'Foo'] as $needle) { printf( "%s => %s\n", $needle, preg_match('#\d+(?=\.' . preg_quote($needle) . ')#', $haystack, $m) ? $m[0] : 'no match' ); }
Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.15, 8.5.0 - 8.5.1
Mazon => 28876 Targo => 28455 Walmo => 28389 Foo => no match

preferences:
88.12 ms | 406 KiB | 5 Q