I have this regex:

```
/\A((\{YY\})?[-_]*(\{MM\})?[-_]*(\{DD\})?[-_]*(\{N{4,8}\})|[A-Za-z])*\z/

```

that matches values such as:

```
{YY}-{MM}-{DD}-{NNNN}

```

Is there a way to limit the number of substrings contained within `{N` and `N}` to one, so that the following string would be invalid?

```
{YY}-{MM}-{DD}-{NNNN}-{NNNNNN}

```

Thanks for any help.