Example 1: javascript regex example match
let reg = /abc/
reg = new RegExp('abc')
let str = 'Abc abc abc'
str.match(/abc/)
str.match(/abc/g)
str.match(/abc/i)
str.match(/abc/ig)
str.match('abc', 'ig')
Example 2: js match any number string
const match = 'some/path/123'.match(/\/(\d+)/)
const id = match[1]
Example 3: how to use the match function in javascript for regex
const str = 'For more information, see Chapter 3.4.5.1';
const re = /see (chapter \d+(\.\d)*)/i;
const found = str.match(re);
console.log(found);
Example 4: regular expression
/findme/
Characters \, ., \cX, \d, \D, \f, \n, \r, \s, \S, \t, \v, \w, \W, \0, \xhh, \uhhhh, \uhhhhh, [\b]
Assertions ^, $, x(?=y), x(?!y), (?<=y)x, (?<!y)x, \b, \B
Groups (x), (?:x), (?<Name>x), x|y, [xyz], [^xyz], \Number
Quantifiers *, +, ?, x{n}, x{n,}, x{n,m}
Unicode \p{UnicodeProperty}, \P{UnicodeProperty}
javascript
let re = /findme/
let defaults = new RegExp('compiled');
defaults = { dotAll: false, flags: "", global: false, ignoreCase: false, falselastIndex: 0, multiline: false, source: "abc", sticky: false, unicode: false}