Replace regexp with list replace

Expanding on the prematurely merged #410

@andrewjstone @jonmeredith