I want to perform a regex using grouping. I am only interested in the grouping, its all I want returned. Is this possible?
$haystack = '<a href="/foo.php">Go To Foo</a>'; $needle = '/href="(.*)">/'; preg_match($needle,$haystack,$matches); print_r($matches); //Outputs //Array (  => href="/foo.php">  => /foo.php ) //I want: //Array (  => /foo.php )
© Stack Overflow or respective owner