From 5e3f8cea1bcb755424bc6f22d142e70d6c9eed1e Mon Sep 17 00:00:00 2001 From: sulyi Date: Tue, 22 Nov 2016 02:36:55 +0100 Subject: [PATCH] [utils] Using non capturing groups in js_to_json --- youtube_dl/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index bcea188a3..548ce12e2 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -2112,8 +2112,8 @@ def js_to_json(code): return re.sub(r'''(?sx) "(?:[^"\\]*(?:\\\\|\\['"nurtbfx/\n]))*[^"\\]*"| '(?:[^'\\]*(?:\\\\|\\['"nurtbfx/\n]))*[^'\\]*'| - ,(?=(\s|(/\*((?!\*/)(\n|.))*\*/))*[\]}])| - /\*((?!\*/)(\n|.))*\*/|[a-zA-Z_][.a-zA-Z_0-9]*| + ,(?=(?:\s|(?:/\*(?:(?!\*/)(?:\n|.))*\*/))*[\]}])| + /\*(?:(?!\*/)(?:\n|.))*\*/|[a-zA-Z_][.a-zA-Z_0-9]*| \b(?:0[xX][0-9a-fA-F]+|0+[0-7]+)(?:\s*:)?| [0-9]+(?=\s*:) ''', fix_kv, code)