/foo bar/;
/foo/dgimyus,
/[\[\]]{2,4}(?:foo)*/;
/foo"test"bar/;
/foo\//;
/[]/;
/[\]/]/;
1 / 4 + "/, not a regex";
/ '1' '2' '3' '4' '5' /
[/foo/]

// RegExp set notation
;/[A--B]/v;
/[A--[0-9]]/v;
/[\p{Decimal_Number}--[0-9]]/v;
/[\p{Script=Khmer}&&[\p{Letter}\p{Mark}\p{Number}]]/v;

let a = /regex/m // comment
let b = condition ? /regex/ : /another one/
return /regex/;
yield /regex/;

----------------------------------------------------

[
	["regex", [
		["regex-delimiter", "/"],
		["regex-source", "foo bar"],
		["regex-delimiter", "/"]
	]],
	["punctuation", ";"],

	["regex", [
		["regex-delimiter", "/"],
		["regex-source", "foo"],
		["regex-delimiter", "/"],
		["regex-flags", "dgimyus"]
	]],
	["punctuation", ","],

	["regex", [
		["regex-delimiter", "/"],
		["regex-source", "[\\[\\]]{2,4}(?:foo)*"],
		["regex-delimiter", "/"]
	]],
	["punctuation", ";"],

	["regex", [
		["regex-delimiter", "/"],
		["regex-source", "foo\"test\"bar"],
		["regex-delimiter", "/"]
	]],
	["punctuation", ";"],

	["regex", [
		["regex-delimiter", "/"],
		["regex-source", "foo\\/"],
		["regex-delimiter", "/"]
	]],
	["punctuation", ";"],

	["regex", [
		["regex-delimiter", "/"],
		["regex-source", "[]"],
		["regex-delimiter", "/"]
	]],
	["punctuation", ";"],

	["regex", [
		["regex-delimiter", "/"],
		["regex-source", "[\\]/]"],
		["regex-delimiter", "/"]
	]],
	["punctuation", ";"],

	["number", "1"],
	["operator", "/"],
	["number", "4"],
	["operator", "+"],
	["string", "\"/, not a regex\""],
	["punctuation", ";"],

	["regex", [
		["regex-delimiter", "/"],
		["regex-source", " '1' '2' '3' '4' '5' "],
		["regex-delimiter", "/"]
	]],

	["punctuation", "["],
	["regex", [
		["regex-delimiter", "/"],
		["regex-source", "foo"],
		["regex-delimiter", "/"]
	]],
	["punctuation", "]"],

	["comment", "// RegExp set notation"],

	["punctuation", ";"],
	["regex", [
		["regex-delimiter", "/"],
		["regex-source", "[A--B]"],
		["regex-delimiter", "/"],
		["regex-flags", "v"]
	]],
	["punctuation", ";"],

	["regex", [
		["regex-delimiter", "/"],
		["regex-source", "[A--[0-9]]"],
		["regex-delimiter", "/"],
		["regex-flags", "v"]
	]],
	["punctuation", ";"],

	["regex", [
		["regex-delimiter", "/"],
		["regex-source", "[\\p{Decimal_Number}--[0-9]]"],
		["regex-delimiter", "/"],
		["regex-flags", "v"]
	]],
	["punctuation", ";"],

	["regex", [
		["regex-delimiter", "/"],
		["regex-source", "[\\p{Script=Khmer}&&[\\p{Letter}\\p{Mark}\\p{Number}]]"],
		["regex-delimiter", "/"],
		["regex-flags", "v"]
	]],
	["punctuation", ";"],

	["keyword", "let"],
	" a ",
	["operator", "="],
	["regex", [
		["regex-delimiter", "/"],
		["regex-source", "regex"],
		["regex-delimiter", "/"],
		["regex-flags", "m"]
	]],
	["comment", "// comment"],

	["keyword", "let"],
	" b ",
	["operator", "="],
	" condition ",
	["operator", "?"],
	["regex", [
		["regex-delimiter", "/"],
		["regex-source", "regex"],
		["regex-delimiter", "/"]
	]],
	["operator", ":"],
	["regex", [
		["regex-delimiter", "/"],
		["regex-source", "another one"],
		["regex-delimiter", "/"]
	]],

	["keyword", "return"],
	["regex", [
		["regex-delimiter", "/"],
		["regex-source", "regex"],
		["regex-delimiter", "/"]
	]],
	["punctuation", ";"],

	["keyword", "yield"],
	["regex", [
		["regex-delimiter", "/"],
		["regex-source", "regex"],
		["regex-delimiter", "/"]
	]],
	["punctuation", ";"]
]

----------------------------------------------------

Checks for regex.
