super nit: instead of having a `count` just for that, i would:

```python
if matches is None return 0 else return count(matches);
```