Use regular expressions for (perhaps) less brittle matching