UNPKG

@ribajs/core

Version:

Core module of Riba.js

12 lines (10 loc) 269 B
import { Formatter } from "../../types/index.js"; export const matchFormatter: Formatter = { name: "match", read(a: string, regexp: string, flags?: string) { if (!a || !regexp) { return false; } return a.match(new RegExp(regexp, flags)); }, };