2018-12-19 14:09:39 +08:00

30 lines
881 B
Plaintext

/foo bar/;
/foo/gimyu,
/[\[\]]{2,4}(?:foo)*/;
/foo"test"bar/;
/foo\//;
/[]/;
/[\]/]/;
1 / 4 + "/, not a regex";
/ '1' '2' '3' '4' '5' /
[/foo/]
----------------------------------------------------
[
["regex", "/foo bar/"], ["punctuation", ";"],
["regex", "/foo/gimyu"], ["punctuation", ","],
["regex", "/[\\[\\]]{2,4}(?:foo)*/"], ["punctuation", ";"],
["regex", "/foo\"test\"bar/"], ["punctuation", ";"],
["regex", "/foo\\//"], ["punctuation", ";"],
["regex", "/[]/"], ["punctuation", ";"],
["regex", "/[\\]/]/"], ["punctuation", ";"],
["number", "1"], ["operator", "/"], ["number", "4"], ["operator", "+"], ["string", "\"/, not a regex\""], ["punctuation", ";"],
["regex", "/ '1' '2' '3' '4' '5' /"],
["punctuation", "["], ["regex", "/foo/"], ["punctuation", "]"]
]
----------------------------------------------------
Checks for regex.