Match on more formats. Refactored regexp construction.