# plainMonthDay

:::caution[Unreleased]
Not in `@northguild/gmt` 1.20.0 on npm yet. It is on `main` and ships in the next release.
:::

```ts
const plainMonthDay: RegExp = /^(?:--)?(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|02-(?:0[1-9]|[12]\d))$/;
```

RegExp matching an ISO 8601 month-day (extended): `--MM-DD` or `MM-DD`.

## Examples

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

```ts
plainMonthDay.test("--12-25") // true
plainMonthDay.test("12-25") // true (the -- is optional)
plainMonthDay.test("--02-29") // true (exists in the 1972 reference year)
plainMonthDay.test("--02-30") // false (no such day in any year)
plainMonthDay.test("--1225") // false (basic format)
```

## Source

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