* (A \gB)? defines that the expression A \gB should be found 0 or 1 (defined by the ? greedy quantifier)
* A \gB defines a pattern that:
* starts with the letter ''A'',
* followed by the group ''S'' (the recursion)
* then the letter ''B''
===== Syntax =====
You define a recursive expression by adding the group name
* In PCRE (perl, php, java, …)
(?R)
* In Ruby
\g<0>
===== Support =====
Recursion is not supported in all regular expression engines. The following engines supports them
* PCRE (Perl, C, PHP, R…)
* Ruby (2+)
* Python with the alternate regex module