MDN self-hosted library · e01.org

Literal character: a, b

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
const pattern = /<.+?>/g;
js
/^[😄]$/.test("😄"); // false, because the pattern is interpreted as /^[\ud83d\ude04]$/
/^😄+$/.test("😄😄"); // false, because the pattern is interpreted as /^\ud83d\ude04+$/
js
const pattern = /a\nb/;
const string = `a
b`;
console.log(pattern.test(string)); // true