JavaScript RegExp Tutorial
A cheat sheet for the regex syntax in JavaScript.
TL&DR
''.test(/^$/);
'ok'.replace(/(.)(.)/g, '$2$1'); // $$, $&, $`, $'
const matchG = 'aaa'.match(/a/g);
matchG == ['a', 'a', 'a'];
const matchNoG = 'str'.match(/(st)r/);
matchNoG == Object.assign(['str', 'st'], {groups: undefined, index: 0, input: 'str'});
matchNoG == /(st)r/.exec('str');