Parses the Time out of the times string.

@param $input
@return null
425974
private function getTime($input)
    {
        //test 12 h format
        preg_match('/(1[012]|[1-9]):[0-5][0-9](\\s)?(?i)(am|pm)/', $input, $matches);
        if (count($matches) > 0) {
            return $matches[0];
        }

        //test 24 h format
        preg_match('/([01]?[0-9]|2[0-3]):[0-5][0-9]/', $input, $matches);
        if (count($matches) > 0) {
            return $matches[0];
        }

        return null;
    }
71364
public static function date($input) {
        $input = Time::toUnix($input);

        if (!$input) {
            return false;
        }

        list($m, $d, $y) = explode('/', date('m/d/Y', $input));

        return checkdate($m, $d, $y);
    }
579561
public static function checkCreateDateTime($input)
    {
        $dateObj = \DateTime::createFromFormat('Y-m-d\TH:i:s', $input);
        if($dateObj !== false && $input === $dateObj->format('Y-m-d\TH:i:s'))
            return $input;
        else
            return false;
    }
354923
function parseTimeStamp(input) {

    function computeSeconds(h, m, s, f) {
      return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000;
    }

    var m = input.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);
    if (!m) {
      return null;
    }

    if (m[3]) {
      // Timestamp takes the form of [hours]:[minutes]:[seconds].[milliseconds]
      return computeSeconds(m[1], m[2], m[3].replace(":", ""), m[4]);
    } else if (m[1] > 59) {
      // Timestamp takes the form of [hours]:[minutes].[milliseconds]
      // First position is hours as it's over 59.
      return computeSeconds(m[1], m[2], 0,  m[4]);
    } else {
      // Timestamp takes the form of [minutes]:[seconds].[milliseconds]
      return computeSeconds(0, m[1], m[2], m[4]);
    }
  }
1035784
public function sanitizeInput(array $input)
    {
        return $input = collect($input)->reject(function ($value) {
            return is_null($value) || empty($value);
        })->toArray();
    }
5462
public function parse($input)
    {
        if (strlen($input) == 0) {
            return null;
        }
        return $this->parser->parse(new TokenStream($this->tokenizer->getTokens($input)));
    }
605217
public function parse(array $input): bool
    {
        $this->resetAggregators();

        $this
            ->validateType($input)
            ->validateId($input)
            ->validateAttributes($input)
            ->validateRelationships($input);

        $hasNoErrors = $this->getJsonApiErrorCollection()->count() <= 0;

        return $hasNoErrors;
    }
766422
@Override
    public Date parseASCIITime(String input) throws ParseException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "ascii parsing [" + input + "]");
        }
        Date d = attemptParse(getFormat().getAsciiParse(), input);
        if (null == d) {
            throw new ParseException("Unparseable [" + input + "]", 0);
        }
        return d;
    }
238539
protected function value($input)
    {
        $output = $input;

        if (is_string($input) === false) {
            switch (gettype($input)) {
                case 'boolean':
                    $output = ($input === true) ? 'true' : 'false';
                    break;
                case 'integer':
                case 'double':
                    $output = (string) $input;
                    break;
                case 'object':
                case 'array':
                case 'resource':
                case 'unknown type':
                    $output = serialize($input);
                    break;
                case 'NULL':
                default:
                    // intentionally omitted
                    break;
            }
        }

        return $output;
    }
106695
private function findMatchingToken($input)
    {
        // Check with all tokenDefinitions
        foreach ($this->tokenDefinitions as $tokenDefinition) {
            $token = $tokenDefinition->match($input);

            // Return the first token that was matched.
            if ($token) {
                return $token;
            }
        }

        // Return null if no tokens were matched.

        return null;
    }
45020
protected function parseString($input)
    {
        $jobs = array();

        $lines = array_filter(explode(PHP_EOL, $input), function($line) {
            return '' != trim($line);
        });

        foreach ($lines as $line) {
            $trimmed = trim($line);

            if (strstr($line, 'PATH=') || strstr($line,'MAILTO=')) {
                continue;
            }
            // if line is not a comment, convert it to a cron
            if (0 !== \strpos($trimmed, '#')) {
                $jobs[] = Job::parse($line);
            }
        }

        return $jobs;
    }
153293
private function parse($input)
    {
        $in_comment = false;

        $in_single_quote = false;
        $in_double_quote = false;

        $skip_char = [
            '{', '}', '[', ']', '>',
            '(', ')', ':', ';', ',',
            '+', '=', '~', '"', "'"
        ];

        $input = str_replace(["\r\n", "\r"], "\n", $input);
        $output = '';

        for ($i = 0;$i < strlen($input);$i++) {
            $char = substr($input, $i, 1);
            $pre_input_char = $i != 0 ? substr($input, $i - 1, 1) : null;
            $pre_output_char = substr($output, -1);

            /**
             * Handle comment block and check end tag
             */
            if ($in_comment) {
                if ('*/' === $pre_input_char . $char) {
                    $in_comment = false;
                }

                continue;
            }

            /**
             * Handle quote block and check end tag
             */
            if ($in_single_quote) {
                if ("'" === $char && '\\' !== $pre_output_char) {
                    $in_single_quote = false;
                }

                $output .= $char;
                continue;
            }

            if ($in_double_quote) {
                if ('"' === $char && '\\' !== $pre_output_char) {
                    $in_double_quote = false;
                }

                $output .= $char;
                continue;
            }

            /**
             * Check start tag of comment block
             */
            if ('/*' === $pre_output_char . $char) {
                $in_comment = true;

                $output = substr($output, 0, strlen($output) - 1);
                continue;
            }

            /**
             * Check start tag of quote block
             */
            if ("'" === $char) {
                if (' ' === $pre_output_char) {
                    $output = substr($output, 0, strlen($output) - 1);
                }

                $in_single_quote = true;

                $output .= $char;
                continue;
            }

            if ('"' === $char) {
                if (' ' === $pre_output_char) {
                    $output = substr($output, 0, strlen($output) - 1);
                }

                $in_double_quote = true;

                $output .= $char;
                continue;
            }

            /**
             * Handle normal block
             */
            if ("\n" === $char || "\t" === $char) {
                continue;
            }

            if (' ' === $char && ' ' === $pre_output_char) {
                continue;
            }

            if (' ' === $char && in_array($pre_output_char, $skip_char)) {
                continue;
            }

            if (' ' === $pre_output_char && in_array($char, $skip_char)) {
                $output = substr($output, 0, strlen($output) - 1);
            }

            if ('(' === $char && 'and' === substr($output, -3)) {
                $char = ' (';
            }

            $output .= $char;
        }

        return trim($output);
    }
299062
public function parseString($input, $config = NULL, $encoding = NULL, $input, $config = NULL, $encoding = NULL)
    {
    }
621240
protected function parseString($input)
    {
        $elements = array();

        $lines = array_filter(explode(PHP_EOL, $input), function($line) {
            return '' != trim($line);
        });

        foreach ($lines as $line) {
            $trimmed = trim($line);
            // if line is not a comment, convert it to a cron
            if (0 !== \strpos($trimmed, '#')) {
                if (preg_match('/^[^\s]+\s?=/', $line)) {
                    $elements[] = Variable::parse($line);
                } else {
                    $elements[] = Job::parse($line);
                }
            }
        }

        return $elements;
    }
23005
public function parse(array $input)
    {
        $this->data = Arr::get($input, 'data');

        if ($this->data === null) {
            return null;
        }

        $this->included = Arr::get($input, 'included', []);
        $this->start();

        return $this->resolver->getResolved();
    }
761556
public function collapse($input)
    {
        $this->inQuotes = false;
        $this->inSingleQuotes = false;
        $this->currentCharacter = false;
        $this->nextCharacter = false;
        $this->lastCharacter = false;
        $this->skipNext = 0;
        $this->lastAdded = 0;
        $this->buildingWord = $this->lastWord = '';

        $initialSize = mb_strlen($input);
        $timeStart = microtime(true);

        $this->input = str_replace(array("\r", "\t"), array('', ' '), trim($input));
        unset($input);

        if (empty($this->input))
        {
            throw new \Exception("No data has been supplied to media collapser.");
        }

        $characterCount = mb_strlen($this->input);

        $output = '';

        for ($i = 0; $i < $characterCount; ++$i)
        {
            if (!empty($this->skipNext)) {
                $this->skipNext--;
                continue;
            }

            $this->currentIndex = $i;
            $character = mb_substr($this->input, $i, 1);
            $this->currentCharacter = ord($character);
            $this->nextCharacter = ($this->currentIndex != $characterCount) ? ord(mb_substr($this->input, $i + 1, 1)) : false;
            $this->lastCharacter = ($this->currentIndex != 0) ? ord(mb_substr($this->input, $i - 1, 1)) : false;

            $methodName = 'handleCharacter' . $this->currentCharacter;

            if (method_exists($this, $methodName))
            {
                $return = $this->$methodName();
            }
            else
            {
                $return = $this->handleCharacter();
            }

            if ($return === false)
            {
                $this->lastWord = $this->buildingWord;
                $this->buildWord = '';
                continue;
            }
            else if ($return === true)
            {
                $output .= $character;
                $this->lastAdded = $this->currentCharacter;

                if (ctype_alpha($character)) {
                    $this->buildingWord .= $character;
                } else {
                    $this->lastWord = $this->buildingWord;
                    $this->buildingWord = '';
                }
            }
            else if (is_string($return))
            {
                $output .= $return;
                $this->lastAdded = ord($output[mb_strlen($output) - 1]);

                $this->lastWord = $this->buildingWord;
                $this->buildingWord = '';
            }
        }

        $this->sizeSavings = ($initialSize - mb_strlen($output));

        if ($this->debug) {
            $output .= "\n" . '/* culled ' . number_format($this->sizeSavings) . ' chars in ' . number_format((microtime(true) - $timeStart) * 1000, 2) . 'ms */';
        }

        return $output;
    }
1165661
private static function parseFromFormat(string $input, string $format)
    {
        $parsedOrNull = null;

        if (($value = DateTimeImmutable::createFromFormat($format, $input)) !== false) {
            $parsedOrNull = $value;
        }

        return $parsedOrNull;
    }