future reference - you can use `assert_produces_warning()` here as well, so you could get down to:

```python
with tm.assert_produces_warning():
    result = values.str.match('.*(BAD[_]+).*(BAD)')
```