const res = /\d*/; console.log(res.test('1hdjkha'));
const res1 = /^\d*$/ console.log(res1.test('')); console.log(res1.test('212131')); console.log(res1.test('2132sssk'));
const a = /\d+/; console.log(a.test('1hdjkha'));
const a1 = /^\d+$/ console.log(a1.test('')); console.log(a1.test('212131')); console.log(a1.test('2132sssk'));
const b = /\d?/; console.log(b.test('121hdjkha'));
const b1 = /^\d?$/ console.log(b1.test('')); console.log(b1.test('2')); console.log(b1.test('2132sssk'));
const c = /\d{3}/; console.log(c.test('1hd123jkha'));
const c1 = /^\d{3}$/ console.log(c1.test('')); console.log(c1.test('212')); console.log(c1.test('2132sssk'));
const d = /\d{3,}/; console.log(d.test('1hd123jkha'));
const d1 = /^\d{3,}$/ console.log(d1.test('')); console.log(d1.test('212')); console.log(d1.test('2132'));
const f = /\d{3,6}/; console.log(f.test('1hd123jkha'));
const f1 = /^\d{3,6}$/ console.log(f1.test('')); console.log(f1.test('212')); console.log(f1.test('213212131321'));
|