I need to turn this:

```
zz  zz zz   zzzzYzzzzXzzzz zz     zzzzzz                zzzz zzYzz

```

into this: 

```
1Y1X1Y1

```

Preferably in one fell swoop. 

`zz\s*zz` is good but you need to run it several times to achieve what I need. 

Pair is the minimum unit of z. 

zz is separated from each other by any number and combination of white spaces (tabs, spaces).

X and Y can be any strings except z and white spaces.

White spaces are always bordered by zz (and are inside Y and X strings).

It would be best if this would be in VBA-compatible syntax.