Civil Date PHP Package

ParseCapture
in package

FinalYes

Represents a token capture in a compiled parse pattern.

Tags
see
CompiledPattern::match()

Table of Contents

Methods

__construct()  : mixed
Creates a parse capture.
calendarScope()  : Calendar|null
Returns the explicit calendar scope of this capture.
parse()  : int
Parses the captured value into a calendar-date field value.
property()  : string
Returns the semantic calendar-date property represented by this capture.
regex()  : string
Returns the regular-expression fragment for capturing this token.

Methods

calendarScope()

Returns the explicit calendar scope of this capture.

public calendarScope() : Calendar|null
Return values
Calendar|null

Explicit calendar scope, or null when unscoped.

parse()

Parses the captured value into a calendar-date field value.

public parse(string $value, Calendar $defaultCalendar, Locale $locale) : int
Parameters
$value : string

Captured input value.

$defaultCalendar : Calendar

Calendar used when this capture is unscoped.

$locale : Locale

Locale definition.

Tags
throws
DateParseException

If the captured value is invalid.

see
ParsableTokenRule::parse()
Return values
int

Parsed field value.

property()

Returns the semantic calendar-date property represented by this capture.

public property() : string
Return values
string

Calendar-date property name.

regex()

Returns the regular-expression fragment for capturing this token.

public regex() : string
Return values
string

Capturing regular-expression fragment.

On this page

Search results