Make an assertion that actual match RegExp expected. If not then throw.
actual
expected
The actual value to be matched.
The expected pattern to match.
Optional
The optional message to display if the assertion fails.
import { assertMatch } from "@std/assert";assertMatch("Raptor", /Raptor/); // Doesn't throwassertMatch("Denosaurus", /Raptor/); // Throws Copy
import { assertMatch } from "@std/assert";assertMatch("Raptor", /Raptor/); // Doesn't throwassertMatch("Denosaurus", /Raptor/); // Throws
Make an assertion that
actualmatch RegExpexpected. If not then throw.