ts-regex-builder
Version:
Maintainable regular expressions for TypeScript and JavaScript.
16 lines (15 loc) • 833 B
JavaScript
;
exports.hexColorValidator = exports.hexColorFinder = void 0;
var _builders = require("../builders.js");
var _anchors = require("../constructs/anchors.js");
var _choiceOf = require("../constructs/choice-of.js");
var _repeat = require("../constructs/repeat.js");
const hexDigit = /[0-9a-f]/;
const hexColorFinder = exports.hexColorFinder = (0, _builders.buildRegExp)(['#', (0, _choiceOf.choiceOf)((0, _repeat.repeat)(hexDigit, 6), (0, _repeat.repeat)(hexDigit, 3)), _anchors.wordBoundary], {
ignoreCase: true,
global: true
});
const hexColorValidator = exports.hexColorValidator = (0, _builders.buildRegExp)([_anchors.startOfString, '#', (0, _choiceOf.choiceOf)((0, _repeat.repeat)(hexDigit, 6), (0, _repeat.repeat)(hexDigit, 3)), _anchors.endOfString], {
ignoreCase: true
});
//# sourceMappingURL=hex-color.js.map