regex w3schools javascript code example Example 1: regular expression in javascript let re = /ab+c/; Example 2: regular expression in javascript let re = new RegExp('ab+c');