use better regex for matching title

Improve regex for matching the title, via @bdolor