https://bugzilla.wikimedia.org/show_bug.cgi?id=25920

--- Comment #15 from Aaron Schulz <jschulz_4...@msn.com> 2010-11-17 21:11:50 
UTC ---
(In reply to comment #13)
> Sorry, but it doesn't work yet.
> 
> The error msg:
>   Compilation failed: reference to non-existent subpattern at offset 163 in
> [myserver]/mediawiki-trunk/includes/IP.php on line 92.

Here is another variant. The forward reference is now a nested reference
(nested refs supported for non-named groups since 2.0). If named groups support
it too, then this should work:

define( 'RE_IPV6_ADD',
    '(?:' . // starts with "::" (includes the address "::")
        '::|:(?::' . RE_IPV6_WORD . '){1,7}' .
    '|' . // ends with "::" (not including the address "::")
        RE_IPV6_WORD . '(?::' . RE_IPV6_WORD . '){0,6}::' .
    '|' . // has no "::"
        RE_IPV6_WORD . '(?::' . RE_IPV6_WORD . '){7}' .
    '|' . // contains one "::" in the middle (awkward regex for PCRE 4.0+
compatibility)
        RE_IPV6_WORD . '(?::(?P<abn>(?!(?P=abn)):(?P<iabn>))?' . RE_IPV6_WORD .
'){1,6}(?P=iabn)' .
        // NOTE: (?!(?P=abn)) fails iff "::" used twice; (?P=iabn) passes iff a
"::" was found.

        // Better regexp (PCRE 7.2+ only), allows intuitive regex concatenation
        #RE_IPV6_WORD . '(?::((?(-1)|:))?' . RE_IPV6_WORD . '){1,6}(?(-2)|^)' .
    ')'
);

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to