This is a little simpler:

```
    if (match[2] && match[2] !== "start" && match[2] !== "end") {
```