+                    // in basic RE syntax groups are inside \(...\)
+                    if ( *++cptr == _T('(') && (flags & wxRE_BASIC) )
+                    {
+                        m_nMatches++;
+                    }
+                }
+                else if ( *cptr == _T('(') && !(flags & wxRE_BASIC) )
+                {
+                    // we know that the previous character is not an unquoted
+                    // backslash because it would have been eaten above, so we
+                    // have a bare '(' and this indicates a group start for the
+                    // extended syntax. '(?' is used for extensions by perl-
+                    // like REs (e.g. advanced), and is not valid for POSIX
+                    // extended, so ignore them always.
+                    if ( cptr[1] != _T('?') )
+                        m_nMatches++;