static func iso8601(timeZone: TimeZone, includingFractionalSeconds: Bool = false, dateSeparator: Date.ISO8601FormatStyle.DateSeparator = .dash, dateTimeSeparator: Date.ISO8601FormatStyle.DateTimeSeparator = .standard, timeSeparator: Date.ISO8601FormatStyle.TimeSeparator = .colon) -> Self
Creates a regex component to match an ISO 8601 date and time string without time zone, and capture the string as a Date
using the specified timeZone
. If the string contains time zone designators, matches up until the start of time zone designators.
static func iso8601WithTimeZone(includingFractionalSeconds: Bool = false, dateSeparator: Date.ISO8601FormatStyle.DateSeparator = .dash, dateTimeSeparator: Date.ISO8601FormatStyle.DateTimeSeparator = .standard, timeSeparator: Date.ISO8601FormatStyle.TimeSeparator = .colon, timeZoneSeparator: Date.ISO8601FormatStyle.TimeZoneSeparator = .omitted) -> Self
Creates a regex component to match an ISO 8601 date and time string, including time zone, and capture the string as a Date
using the time zone as specified in the string.
static func date(_ style: Date.FormatStyle.DateStyle, locale: Locale, timeZone: TimeZone, calendar: Calendar? = nil) -> Date.ParseStrategy
Creates a regex component to match a localized date string and capture the string as a Date
. The string is expected to follow the format of what Date.FormatStyle(date:locale:calendar:)
produces. Date
created by this regex component would be at 00:00:00 in the specified time zone.
static func date(format: Date.FormatString, locale: Locale, timeZone: TimeZone, calendar: Calendar? = nil, twoDigitStartDate: Date = Date(timeIntervalSince1970: 0)) -> Self
Creates a regex component to match a localized date string following the specified format and capture the string as a Date
.
static func dateTime(date: Date.FormatStyle.DateStyle, time: Date.FormatStyle.TimeStyle, locale: Locale, timeZone: TimeZone, calendar: Calendar? = nil) -> Date.ParseStrategy
Creates a regex component to match a localized date and time string and capture the string as a Date
. The date string is expected to follow the format of what Date.FormatStyle(date:time:locale:calendar:)
produces.
static func localizedCurrency(code: Locale.Currency, locale: Locale) -> Self
Creates a regex component to match a localized currency string and capture it as a Decimal
. For example, localizedIntegerCurrency(code: "USD", locale: Locale(identifier: "en_US"))
matches “$52,249.98” and captures it as 52249.98.
static func localizedIntegerCurrency(code: Locale.Currency, locale: Locale) -> Self
Creates a regex component to match a localized currency string and capture it as a Int
. For example, localizedIntegerCurrency(code: "USD", locale: Locale(identifier: "en_US"))
matches “$52,249” and captures it as 52249.