Verify a date format from a post response

Maybe something like this:

pm.test("DoB Matches", () => {
    pm.expect(path.to.DateofBirth).to.match(/^\d{2}-\d{2}-\d{4}\/\^\/\d{2}-\d{2}-\d{4}$/);
});
1 Like