Does lookaround affect which languages can be matched by regular expressions?

The answer to the question you ask, which is whether a larger class of languages than the regular languages can be recognised with regular expressions augmented by lookaround, is no. A proof is relatively straightforward, but an algorithm to translate a regular expression containing lookarounds into one without is messy. First: note that you can … Read more

Regular Expressions: Is there an AND operator?

Use a non-consuming regular expression. The typical (i.e. Perl/Java) notation is: (?=expr) This means “match expr but after that continue matching at the original match-point.” You can do as many of these as you want, and this will be an “and.” Example: (?=match this expression)(?=match this too)(?=oh, and this) You can even add capture groups … Read more