From b94c01f29408600721c7e3302392e9015fc7bafd Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 30 Nov 2020 18:13:47 +0100 Subject: syntax: recognize single-char escapes in regex literals again Ensure that the single char escapes `\a`, `\b`, `\e`, `\f`, `\n`, `\r`, `\t` and `\v` keep working. Since they're not part of the POSIX extended regular expression spec, they're not handled by the RE engine so we need to substitute them by their actual byte value while parsing the literal. Fixes: ac5cb87 ("syntax: fix string and regex literal parsing quirks") Signed-off-by: Jo-Philipp Wich --- tests/00_syntax/21_regex_literals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/00_syntax') diff --git a/tests/00_syntax/21_regex_literals b/tests/00_syntax/21_regex_literals index bbb78fb..4aef33f 100644 --- a/tests/00_syntax/21_regex_literals +++ b/tests/00_syntax/21_regex_literals @@ -4,7 +4,7 @@ within regular expression literals is subject of the underlying regular expression engine. -- Expect stdout -- -[ "/Hello world/", "/test/gis", "/test/g", "/test1 \\\/ test2/", "/\\x31\\n\\.\\a\\b\\c\\u2600\\\\/" ] +[ "/Hello world/", "/test/gis", "/test/g", "/test1 \\\/ test2/", "/\\x31\n\\.\u0007\b\\c\\u2600\\\\/" ] -- End -- -- Testcase -- -- cgit v1.2.3