dotnet/runtime

Regex - Support Possessive Quantifiers

Open

#24.381 geöffnet am 7. Dez. 2017

Auf GitHub ansehen
 (9 Kommentare) (5 Reaktionen) (0 zugewiesene Personen)C# (5.445 Forks)batch import
area-System.Text.RegularExpressionsenhancementhelp wanted

Repository-Metriken

Stars
 (17.886 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 12T 11h) (661 gemergte PRs in 30 T)

Beschreibung

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.

Contributor Guide