This commit is contained in:
joaquinelio 2021-05-15 00:16:49 -03:00 committed by GitHub
parent 6ad89303b0
commit fafab82e8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -242,7 +242,7 @@ And in the original example `pattern:^(\w+\s?)*$` we may want to forbid backtrac
Modern regular expression engines support possessive quantifiers for that. Regular quantifiers become possessive if we add `pattern:+` after them. That is, we use `pattern:\d++` instead of `pattern:\d+` to stop `pattern:+` from backtracking.
Possessive quantifiers are in fact simpler than "regular" ones. They just match as many as they can, without any backtracking. The search process without bracktracking is simpler.
Possessive quantifiers are in fact simpler than "regular" ones. They just match as many as they can, without any backtracking. The search process without backtracking is simpler.
There are also so-called "atomic capturing groups" - a way to disable backtracking inside parentheses.