Question: Backreferences, Redux Many software tools for matching text support backreferences, which are able to match multiple occurrences of the same text. Consider the following extension

Backreferences, Redux
Many software tools for matching text support backreferences, which are able to match multiple occurrences of the same text. Consider the following extension to regular expressions to support backreferences. A capture operator stores matched text, and a backref operator matches the ith capture. Specifically, the operators in s-expression notation are:
(capture e) is a unary operator that takes a single expression e and stores the text from the input string that matches e.
(backref i) is a unary operator that takes a single non-negative integer i and matches the text of the ith capture in the overall expression.
For example:
The expression (concatenation (capture a)(capture b)(backref 1)) would match only the string abb.
The expression (concatenation (capture (union a b))(backref 0)) would match the text aa and bb, but it would not match the text ab or ba.
Prove regular expressions extended with backreferences are not context-free.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!