Is an atomic quantitative group the same as a quantitative atomic group?

I looked at this answer to this question: nested parentheses and thought that instead of this quantized atomic group (?> list | of | alternates )*it should have been an atomic quantified group (?> (?: list | of | alternates )* ). Am I mistaken? Are they the same or different in the world of regular expressions? Especially in terms of .NET implementation?

I personally think they are different, and I usually use perl regular expressions to be translated into (?: list | of | alternates )*+. In any case, this is much clearer, stating that I want to return to this particular regular expression if necessary (atomic quantity group). However, perhaps this is what was implemented as a design solution, in which the idea that a quantitative atomic group is not useful?

+4
source share
1 answer

When an atomic group is invoked as an independent expression, backtracking does occur inside it, as elsewhere.

The difference is that the atomic group cannot control the reverse tracking mechanism from the outside.

, , .

, , , .

.

(?>a|b|c)*abc aaaaaabbbbbbbbbbbabc

as

(?>(?:a|b|c)*)abc aaaaaabbbbbbbbbbbabc
(?:a|b|c)* , abc.

:

, .

, .

, , , " ( ), .

+3

Source: https://habr.com/ru/post/1692392/


All Articles