UNPKG

@genexus/web-standard-functions

Version:

GeneXus JavaScript standard functions library for web generators

23 lines 628 B
"use strict"; /** * Test a string against regexp * @param {string} target * @param {string} regExp * @return boolean */ Object.defineProperty(exports, "__esModule", { value: true }); exports.isMatch = void 0; const gxRegEx_1 = require("../types/gxRegEx"); const isMatch = (target, regExp) => { try { new gxRegEx_1.GxRegEx(0, ""); let rex = typeof regExp === "string" ? new RegExp(regExp) : regExp; return rex.exec(target) !== null; } catch (err) { new gxRegEx_1.GxRegEx(1, err.message); return null; } }; exports.isMatch = isMatch; //# sourceMappingURL=isMatch.js.map