original_string: public static function formatRegex($pattern)
      {
          if (strpos($pattern, '/') !== false
              && strpos($pattern, '\\/') === false
          ) {
              $pattern = str_replace('/', '\\/', $pattern);
          }
          return '/' . $pattern . '/';
      }
code: public static function formatRegex($pattern)
      {
          if (strpos($pattern, '/') !== false
              && strpos($pattern, '\\/') === false
          ) {
              $pattern = str_replace('/', '\\/', $pattern);
          }
          return '/' . $pattern . '/';
      }
code_tokens: public static function formatRegex ( $ pattern ) { if ( strpos ( $ pattern , '/' ) !== false && strpos ( $ pattern , '\\/' ) === false ) { $ pattern = str_replace ( '/' , '\\/' , $ pattern ) ; } return '/' . $ pattern . '/' ; }
docstring: Formats a goal regex pattern to a usable regex
  
  @param string $pattern
  @return string
docstring_tokens: Formats a goal regex pattern to a usable regex