@genexus/web-standard-functions
Version:
GeneXus JavaScript standard functions library for web generators
19 lines • 482 B
JavaScript
/**
* Test a string against regexp
* @param {string} target
* @param {string} regExp
* @return boolean
*/
import { GxRegEx } from "../types/gxRegEx";
export const isMatch = (target, regExp) => {
try {
new GxRegEx(0, "");
let rex = typeof regExp === "string" ? new RegExp(regExp) : regExp;
return rex.exec(target) !== null;
}
catch (err) {
new GxRegEx(1, err.message);
return null;
}
};
//# sourceMappingURL=isMatch.js.map