You are here

private static function Inline::getTimestampRegex in Translation template extractor 6.3

Same name and namespace in other branches
  1. 7.3 vendor/Symfony/Component/Yaml/Inline.php \Symfony\Component\Yaml\Inline::getTimestampRegex()
  2. 7.2 vendor/Symfony/Component/Yaml/Inline.php \Symfony\Component\Yaml\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 vendor/Symfony/Component/Yaml/Inline.php
Dumps a given PHP variable to a YAML string.
Inline::evaluateScalar in vendor/Symfony/Component/Yaml/Inline.php
Evaluates scalars and replaces magic values.

File

vendor/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;
}