Factor regex error messages with spec API tests