import {Validator} from './Validator'; export class RegExpTestValidator extends Validator { public regexp: RegExp; constructor(regexp: RegExp, value?: T, target?: E, event?: Event, autoValid = true) { super(value, target, event, autoValid); this.regexp = regexp } valid(): boolean { const value = this.value as unknown as string; const regExp = (this.regexp as any)._DomRender_origin ?? this.regexp; // console.log('regexp-->', value, this.regexp, regExp.test(value)) if (value) { return regExp.test(value); } else { return false; } } }