private static function Inline::getTimestampRegex

Gets a regex that matches a YAML date.

Return value

string The regular expression

See also

http://www.yaml.org/spec/1.2/spec.html#id2761573

2 calls to Inline::getTimestampRegex()
Inline::dump in drupal/core/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php
Dumps a given PHP variable to a YAML string.
Inline::evaluateScalar in drupal/core/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php
Evaluates scalars and replaces magic values.

File

drupal/core/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php, line 445

Class

Inline
Inline implements a YAML parser/dumper for the YAML inline syntax.

Namespace

Symfony\Component\Yaml

Code

private static function getTimestampRegex() {
  return <<<EOF
        ~^
        (?P<year>[0-9][0-9][0-9][0-9])
        -(?P<month>[0-9][0-9]?)
        -(?P<day>[0-9][0-9]?)
        (?:(?:[Tt]|[ \t]+)
        (?P<hour>[0-9][0-9]?)
        :(?P<minute>[0-9][0-9])
        :(?P<second>[0-9][0-9])
        (?:\\.(?P<fraction>[0-9]*))?
        (?:[ \t]*(?P<tz>Z|(?P<tz_sign>[-+])(?P<tz_hour>[0-9][0-9]?)
        (?::(?P<tz_minute>[0-9][0-9]))?))?)?
        \$~x
EOF;
}