It's better and clearer to use raw strings for regexps
```python
r'[^\d]*?TEST-BUILD-[^\d]*(\d*).\w*'
```
Some editors (like sublime) even have special mode for raw strings where regexp has its own syntax highlighting.