# fhirInstant

Industry: Core

```ts
const fhirInstant: RegExp = /^([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))$/;
```

RegExp matching a FHIR R4 `instant`: the `regex` of the `instant` StructureDefinition (https://hl7.org/fhir/R4/instant.profile.json), verbatim and anchored.

## Examples

```ts
import { fhirInstant } from "@northguild/gmt";
```

```ts
fhirInstant.test("2015-02-07T13:28:17.239+02:00") // true
fhirInstant.test("2024-06-15T10:30:00Z") // true
fhirInstant.test("2024-06-15") // false (an instant needs a time)
fhirInstant.test("2024-06-15T10:30:00") // false (a zone is required)
fhirInstant.test("2024-06-15T10:30:00z") // false (upper-case Z only)
```

## Source

[regex/fhir.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/regex/fhir.ts)
