Without the use of recursion, the best that can be done is to use a patternWithout the use of recursion, the best that can be done is to use a pattern that matches up to some fixed depth of nesting.
Outside a character class, a dot in the pattern matches any one character in the subject, including a non-printing character, but not (by default) newline. If the PCRE_DOTALL option is set, then dots match newlines as well. The han- dling of dot is entirely independent of the handling of cir- cumflex and dollar, the only relationship being that they both involve newline characters. Dot has no special meaning in a character class.