@angular-ru/cdk/regexp
console.log(ensureRegexp('/^a$/')); // "^a$"console.log(isRegexpStr('/hello/')); // true
console.log(isRegexpStr('/^abc$/')); // true
console.log(isRegexpStr('HELLO')); // false
console.log(isRegexpStr('123')); // falseconsole.log(matchedByRegExp('/hello/', 'hello world')); // true
console.log(matchedByRegExp('/1$/', '2020')); // falseexpect(REG_EXP_STRICT_NAME.test('aaaBBB')).toEqual(true);
expect(REG_EXP_STRICT_NAME.test('_aaa_bbb_')).toEqual(true);
expect(REG_EXP_STRICT_NAME.test('aaabbb777')).toEqual(true);
expect(REG_EXP_STRICT_NAME.test('777aaaBBB')).toEqual(false);
expect(REG_EXP_STRICT_NAME.test('aaa BBB')).toEqual(false);
expect(REG_EXP_STRICT_NAME.test('aaaBBB!')).toEqual(false);
expect(REG_EXP_STRICT_NAME.test('aaaДДД')).toEqual(false);Last updated