dotnet/runtime

Regex - Support Possessive Quantifiers

Open

#24,381 创建于 2017年12月7日

在 GitHub 查看
 (9 评论) (5 反应) (0 负责人)C# (5,445 fork)batch import
area-System.Text.RegularExpressionsenhancementhelp wanted

仓库指标

Star
 (17,886 star)
PR 合并指标
 (平均合并 12天 11小时) (30 天内合并 661 个 PR)

描述

Current popular regex engines like java.util.regex or PCRE support greedy, lazy and possessive quantifiers. The current .NET regex engine does only support the former two. Though possessive quantifiers are syntactic sugar and can be mimicked with atomic grouping today, consider supporting them as they gained popularity over the last years.

Abstract: Possessive quantifiers work the same as greedy quantifiers but without backtracking on the input string. That means that the following pattern D++[A-Z]+ matches the input string DDDDE but not DDDD.

贡献者指南