You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In principle we only need to "record" (i.e., create new subNFA graphs) for captures that are actually used by some later backreference. I.e., in (.)(.)(.)\1\3 we currently record all three groups but only 1 and 3 are actually used. In principle it could be written with 2 as a non-capturing group like (.)(?:.)(.)\1\2 but we don't want to rely on the user for that.
Since number of unique backreferences is limited (to nine, i.e. \1 through \9), but the number of capture groups is unlimited, the behavior is important since if limited the captures based on found backreferences we can claim we are in P regardless of the regex.
This is as simple as scanning the regex after parsing and limiting the captures to those with at least one corresponding backreference.
The text was updated successfully, but these errors were encountered:
In principle we only need to "record" (i.e., create new subNFA graphs) for captures that are actually used by some later backreference. I.e., in
(.)(.)(.)\1\3
we currently record all three groups but only 1 and 3 are actually used. In principle it could be written with 2 as a non-capturing group like(.)(?:.)(.)\1\2
but we don't want to rely on the user for that.Since number of unique backreferences is limited (to nine, i.e.
\1
through\9
), but the number of capture groups is unlimited, the behavior is important since if limited the captures based on found backreferences we can claim we are in P regardless of the regex.This is as simple as scanning the regex after parsing and limiting the captures to those with at least one corresponding backreference.
The text was updated successfully, but these errors were encountered: