Replace re calls

Prefer lists calls or list comprehensions to regexps.

2 commits because of my crapping skills in rebasing.