<?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' ); }
You have javascript disabled. You will not be able to edit any code.