    # File lib/locale/tag/rfc.rb, line 32
            def parse(tag)
              if tag =~ /\APOSIX\Z/  # This is the special case of POSIX locale but match this regexp.
                nil
              elsif tag =~ TAG_RE
                lang, script, region, subtag = $1, $2, $3, $4
                extensions = []
                variants = []
                if subtag =~ /#{PRIVATEUSE}/
                    subtag, privateuse = $`, $1
                  # Private use for CLDR.
                  if /x-ldml(.*)/ =~ privateuse
                    p_subtag = $1
                    extensions = p_subtag.scan(/(^|-)#{EXTENSION}/i).collect{|v| p_subtag.sub!(v[1], ""); v[1]}
                    variants = p_subtag.scan(/(^|-)#{VARIANT}(?=(-|$))/i).collect{|v| v[1]}
                  end
                end
                extensions += subtag.scan(/(^|-)#{EXTENSION}/i).collect{|v| subtag.sub!(v[1], ""); v[1]}
                variants += subtag.scan(/(^|-)#{VARIANT}(?=(-|$))/i).collect{|v| v[1]}

                ret = self.new(lang, script, region, variants, extensions, privateuse)
                ret.tag = tag
                ret
              else
                nil
              end
            end