What kind of formal languages can modern regex engines parse?

I recently wrote a rather long article on this topic: The true power of regular expressions. To summarize: Regular expressions with support for recursive subpattern references can match all context-free languages (e.g a^n b^n). Regular expressions with lookaround assertions and subpattern references can match at least some context-sensitive languages (e.g. ww and a^n b^n c^n). … Read more

Example of Non-Linear, UnAmbiguous and Non-Deterministic CFL?

“IN CONTEXT OF CHOMSHY CLASSIFICATION OF FORMAL LANGUAGE” (1) L3 = {wwR | w ∈ {a, b}* } Language L3 is a Non-Deterministic Context Free Language, its also Unambiguous and Liner language. (2) Lp is language of parenthesis matching. There are two terminal symbols “(” and “)”. Grammar for Lp is: S → SS S … Read more

Left-Linear and Right-Linear Grammars

Constructing an equivalent Regular Grammar from a Regular Expression First, I start with some simple rules to construct Regular Grammar(RG) from Regular Expression(RE). I am writing rules for Right Linear Grammar (leaving as an exercise to write similar rules for Left Linear Grammar) NOTE: Capital letters are used for variables, and small for terminals in … Read more