This is the second part of a series of educational regex articles. It shows how lookaheads and nested references can be used to match the non-regular
Given that no mention has been made of PCRE supporting recursive patterns, I'd just like to point out the simplest and most efficient example of PCRE that describes the language in question:
/^(a(?1)?b)$/