ruby-changes:71273
From: Nobuyoshi <ko1@a...>
Date: Fri, 25 Feb 2022 19:52:45 +0900 (JST)
Subject: [ruby-changes:71273] c8cddac45c (master): [ruby/date] Use possessive match
https://git.ruby-lang.org/ruby.git/commit/?id=c8cddac45c From c8cddac45c3786afc737ac9c1075d77d8f752d3d Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Fri, 9 Jul 2021 06:35:58 +0900 Subject: [ruby/date] Use possessive match Reduce backtracks at the same character classes arounding an optional pattern. https://github.com/ruby/date/commit/1fd15f7c49 --- ext/date/date_parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/date/date_parse.c b/ext/date/date_parse.c index 91e294e4aa..0e7067f4d8 100644 --- a/ext/date/date_parse.c +++ b/ext/date/date_parse.c @@ -922,8 +922,8 @@ parse_us(VALUE str, VALUE hash) https://github.com/ruby/ruby/blob/trunk/ext/date/date_parse.c#L922 COM_FPT #endif "(?:" - "\\s*,?" - "\\s*" + "\\s*+,?" + "\\s*+" #ifndef TIGHT_PARSER "(c(?:e|\\.e\\.)|b(?:ce|\\.c\\.e\\.)|a(?:d|\\.d\\.)|b(?:c|\\.c\\.))?" "\\s*" -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/