/**
  * This method is used to optimize the matching process.
  *
  * @param \TYPO3\Flow\Aop\Builder\ClassNameIndex $classNameIndex
  * @return \TYPO3\Flow\Aop\Builder\ClassNameIndex
  */
 public function reduceTargetClassNames(\TYPO3\Flow\Aop\Builder\ClassNameIndex $classNameIndex)
 {
     if (!preg_match('/^([^\\.\\(\\)\\{\\}\\[\\]\\?\\+\\$\\!\\|]+)/', $this->originalExpressionString, $matches)) {
         return $classNameIndex;
     }
     $prefixFilter = $matches[1];
     // We sort here to make sure the index is okay
     $classNameIndex->sort();
     return $classNameIndex->filterByPrefix($prefixFilter);
 }