Question: Regular expressions vs. Unix regular expressions. Regular expressions and Unix regular expressions have some superficial differences, but also some deeper ones that affect the class


Regular expressions vs. Unix regular expressions. Regular expressions and Unix regular expressions have some superficial differences, but also some deeper ones that affect the class of languages recognized. (a) Unix regular expressions have quantifiers: if is a regular expression, {m,n} is a regular expression that matches at least m and no more than n strings that match . More formally, it matches all strings w(1)w(l) where mln, and for all i such that 1il,w(i) matches . Prove that for any regular expression with quantifiers, there is an equivalent regular expression without quantifiers. (b) Unix regular expressions have backreferences. 1 Give an example of a Unix regular expression that uses backreferences to describe a nonregular language, and prove that this language is not regular. We want you to get practice writing a non-regularity proof, so although you may use Examples 1.73-77, do not simply cite one of them; please write out a full proof
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
