src/SlugGenerator.php
private function getRanges(string $text, string $regex): array
	{
		preg_match_all($regex, $text, $matches, PREG_OFFSET_CAPTURE);

		$ranges = array_map(function ($match) {
			return [$match[1], strlen($match[0])];
		}, $matches[0]);

		return $ranges;
	}
private function getRanges(string $text, string $regex): array
	{
		preg_match_all($regex, $text, $matches, PREG_OFFSET_CAPTURE);

		$ranges = array_map(function ($match) {
			return [$match[1], strlen($match[0])];
		}, $matches[0]);

		return $ranges;
	}
private function getRanges ( string $ text , string $ regex ) : array { preg_match_all ( $ regex , $ text , $ matches , PREG_OFFSET_CAPTURE ) ; $ ranges = array_map ( function ( $ match ) { return [ $ match [ 1 ] , strlen ( $ match [ 0 ] ) ] ; } , $ matches [ 0 ] ) ; return $ ranges ; }
Get all matching ranges.

@param string $text
@param string $regex

@return array Array of range arrays, each consisting of index and length
Get all matching ranges .