blob: bdbf885a804f496b8313f2f087deab6a84cf383f [file] [log] [blame]
/**
* Regex object for checking the context of the hint
*/
define({
create : function (regex) {
return Object.create(this)._init(regex);
},
_init : function (regex) {
try {
this._regex = new RegExp(regex);
}
catch (e) {
KorAP.log(0, e);
return;
};
return this;
},
test : function (text) {
if (!this._regex.exec(text))
return;
return RegExp.$1;
}
});