```
match_data = heartbeat_data.scan(pattern).join('')
```