1// javascript regex Zero or one occurrence
2let neighbor = /neighbou?r/;
3console.log(neighbor.test("neighbour")); // true
4console.log(neighbor.test("neighbor")); // true
1// /x*/ - Regular Expression zero or more occurrence
2console.log(/'\d*'/.test("'123'"));// true
3console.log(/'\d*'/.test("''"));// true