original_string: public function getReverseMatchingRegExp($pattern)
      {
          $escapedPattern = preg_quote($pattern, '/');
  
          // ICU 4.8 recognizes slash ("/") in a value to be parsed as a dash ("-") and vice-versa
          // when parsing a date/time value
          $escapedPattern = preg_replace('/\\\[\-|\/]/', '[\/\-]', $escapedPattern);
  
          $reverseMatchingRegExp = preg_replace_callback($this->regExp, function ($matches) {
              $length = \strlen($matches[0]);
              $transformerIndex = $matches[0][0];
  
              $dateChars = $matches[0];
              if ($this->isQuoteMatch($dateChars)) {
                  return $this->replaceQuoteMatch($dateChars);
              }
  
              $transformers = $this->getTransformers();
              if (isset($transformers[$transformerIndex])) {
                  $transformer = $transformers[$transformerIndex];
                  $captureName = str_repeat($transformerIndex, $length);
  
                  return "(?P<$captureName>".$transformer->getReverseMatchingRegExp($length).')';
              }
          }, $escapedPattern);
  
          return $reverseMatchingRegExp;
      }
code: public function getReverseMatchingRegExp($pattern)
      {
          $escapedPattern = preg_quote($pattern, '/');
  
          // ICU 4.8 recognizes slash ("/") in a value to be parsed as a dash ("-") and vice-versa
          // when parsing a date/time value
          $escapedPattern = preg_replace('/\\\[\-|\/]/', '[\/\-]', $escapedPattern);
  
          $reverseMatchingRegExp = preg_replace_callback($this->regExp, function ($matches) {
              $length = \strlen($matches[0]);
              $transformerIndex = $matches[0][0];
  
              $dateChars = $matches[0];
              if ($this->isQuoteMatch($dateChars)) {
                  return $this->replaceQuoteMatch($dateChars);
              }
  
              $transformers = $this->getTransformers();
              if (isset($transformers[$transformerIndex])) {
                  $transformer = $transformers[$transformerIndex];
                  $captureName = str_repeat($transformerIndex, $length);
  
                  return "(?P<$captureName>".$transformer->getReverseMatchingRegExp($length).')';
              }
          }, $escapedPattern);
  
          return $reverseMatchingRegExp;
      }
code_tokens: public function getReverseMatchingRegExp ( $ pattern ) { $ escapedPattern = preg_quote ( $ pattern , '/' ) ; // ICU 4.8 recognizes slash ("/") in a value to be parsed as a dash ("-") and vice-versa // when parsing a date/time value $ escapedPattern = preg_replace ( '/\\\[\-|\/]/' , '[\/\-]' , $ escapedPattern ) ; $ reverseMatchingRegExp = preg_replace_callback ( $ this -> regExp , function ( $ matches ) { $ length = \ strlen ( $ matches [ 0 ] ) ; $ transformerIndex = $ matches [ 0 ] [ 0 ] ; $ dateChars = $ matches [ 0 ] ; if ( $ this -> isQuoteMatch ( $ dateChars ) ) { return $ this -> replaceQuoteMatch ( $ dateChars ) ; } $ transformers = $ this -> getTransformers ( ) ; if ( isset ( $ transformers [ $ transformerIndex ] ) ) { $ transformer = $ transformers [ $ transformerIndex ] ; $ captureName = str_repeat ( $ transformerIndex , $ length ) ; return "(?P<$captureName>" . $ transformer -> getReverseMatchingRegExp ( $ length ) . ')' ; } } , $ escapedPattern ) ; return $ reverseMatchingRegExp ; }
docstring: Retrieve a regular expression to match with a formatted value.
  
  @param string $pattern The pattern to create the reverse matching regular expression
  
  @return string The reverse matching regular expression with named captures being formed by the
  transformer index in the $transformer array
docstring_tokens: Retrieve a regular expression to match with a formatted value .