Open this example in the interactive library
Source code
import assert from "node:assert/strict";
console.log((assert.match("item-123", /^item-\d+$/), "passed"));
Sample output
passed

Open this example in the interactive library
import assert from "node:assert/strict";
console.log((assert.match("item-123", /^item-\d+$/), "passed"));
passed