# File lib/Getopt/DelimScanner.rb, line 851
    def matchQuotelike( prefix, matchRawRegex )
        startPos = self.pointer
        debugMsg 2, "matchQuotelike starting at pos = %d: prefix = %s, "\
            "matchRawRegex = %s",
            startPos, prefix.inspect, matchRawRegex.inspect

        # Init position markers

        rval = oppos = preldpos = ldpos = strpos = rdpos = modpos = nil

        # Look for the prefix

        raise MatchFailure, "Did not find prefix: /#{prefix.inspect}/" unless
            self.skip( prefix )
        oppos = self.pointer


        # Peek at the next character

        # If the initial quote is a simple quote, our job is easy

        if self.check(/^["`']/) || ( matchRawRegex && self.check(%r:/:) )

            initial = self.matched

            # Build the pattern for matching the simple string

            pattern = "%s [^\\%s]* (\\.[^\\%s]*)* %s" %
                [ Regexp.quote(initial),
                  initial, initial,
                  Regexp.quote(initial) ]
            debugMsg 2, "Matching simple quote at offset %d with /%s/" % 
                [ self.pointer, pattern ]

            # Search for it, raising an exception if it's not found

            unless self.scan( /#{pattern}/xism )
                raise MatchFailure,
                    "Did not find closing delimiter to match '%s' at '%s...' (offset %d)" %
                    [ initial, self.string[ oppos, 20 ].chomp, self.pointer ]
            end

            modpos = self.pointer
            rdpos = modpos - 1

            # If we're matching a regex, look for any trailing modifiers

            if initial == '/'
                pattern = if RUBY_VERSION >= "1.7.3" then /[imoxs]*/ else /[imox]*/ end
                self.scan( pattern )
            end

            rval = {
                :prefix     => self.string[ startPos, (oppos-startPos) ],
                :match      => self.string[ oppos .. (self.pointer - 1) ],
                :leftDelim  => self.string[ oppos, 1 ],
                :delimText  => self.string[ (oppos+1) .. (rdpos-1) ],
                :rightDelim => self.string[ rdpos, 1 ],
                :modifiers  => self.string[ modpos, (self.pointer-modpos) ],
                :suffix     => self.string[ self.pointer.. -1 ],
            }

        # If it's one of the fancy quotelike operators, our job is somewhat

        # complicated (though nothing like Perl's, thank the Goddess)

        elsif self.scan( %r:%[rwqQx]?(?=\S): )
            op = self.matched
            debugMsg 2, "Matching a real quotelike ('%s') at offset %d" % 
                [ op, self.pointer ]
            modifiers = nil

            ldpos = self.pointer
            strpos = ldpos + 1

            # Peek ahead to see what the delimiter is

            ldel = self.check( /\S/ )
            
            # If it's a bracketing character, just use matchBracketed

            if ldel =~ /[\[(<{]/
                rdel = ldel.tr( '[({<', '])}>' )
                debugMsg 4, "Left delim is a bracket: %s; looking for compliment: %s" %
                    [ ldel, rdel ]
                self.matchBracketed( '', Regexp::quote(ldel), nil, nil, Regexp::quote(rdel) )
            else
                debugMsg 4, "Left delim isn't a bracket: '#{ldel}'; looking for closing instance"
                self.scan( /#{ldel}[^\\#{ldel}]*(\\.[^\\#{ldel}]*)*#{ldel}/ ) or
                    raise MatchFailure,
                    "Can't find a closing delimiter '%s' at '%s...' (offset %d)" %
                    [ ldel, self.rest[0,20].chomp, self.pointer ]
            end
            rdelpos = self.pointer - 1

            # Match modifiers for Regexp quote

            if op == '%r'
                pattern = if RUBY_VERSION >= "1.7.3" then /[imoxs]*/ else /[imox]*/ end
                modifiers = self.scan( pattern ) || ''
            end

            rval = {
                :prefix     => self.string[ startPos, (oppos-startPos) ],
                :match      => self.string[ oppos .. (self.pointer - 1) ],
                :quoteOp    => op,
                :leftDelim  => self.string[ ldpos, 1 ],
                :delimText  => self.string[ strpos, (rdelpos-strpos) ],
                :rightDelim => self.string[ rdelpos, 1 ],
                :modifiers  => modifiers,
                :suffix     => self.string[ self.pointer.. -1 ],
            }

        # If it's a here-doc, things get even hairier.

        elsif self.scan( %r:<<(-)?: )
            debugMsg 2, "Matching a here-document at offset %d" % self.pointer
            op = self.matched

            # If there was a dash, start with optional whitespace

            indent = self[1] ? '\s*' : ''
            ldpos = self.pointer
            label = ''

            # Plain identifier

            if self.scan( /[A-Za-z_]\w*/ )
                label = self.matched
                debugMsg 3, "Setting heredoc terminator to bare identifier '%s'" % label

            # Quoted string

            elsif self.scan( / ' ([^'\\]* (?:\\.[^'\\]*)*) ' /sx ) ||
                  self.scan( / " ([^"\\]* (?:\\.[^"\\]*)*) " /sx ) ||
                  self.scan( / ` ([^`\\]* (?:\\.[^`\\]*)*) ` /sx )
                label = self[1]
                debugMsg 3, "Setting heredoc terminator to quoted identifier '%s'" % label

            # Ruby, unlike Perl, requires a terminal, even if it's only an empty

            # string

            else
                raise MatchFailure,
                    "Missing heredoc terminator before end of line at "\
                    "'%s...' (offset %d)" %
                    [ self.rest[0,20].chomp, self.pointer ]
            end
            extrapos = self.pointer

            # Advance to the beginning of the string

            self.skip( /.*\n/ )
            strpos = self.pointer
            debugMsg 3, "Scanning until /\\n#{indent}#{label}\\n/m"

            # Match to the label

            unless self.scan_until( /\n#{indent}#{label}\n/m )
                raise MatchFailure,
                    "Couldn't find heredoc terminator '%s' after '%s...' (offset %d)" %
                    [ label, self.rest[0,20].chomp, self.pointer ]
            end

            rdpos = self.pointer - self.matched_size

            rval = {
                :prefix     => self.string[ startPos, (oppos-startPos) ],
                :match      => self.string[ oppos .. (self.pointer - 1) ],
                :quoteOp    => op,
                :leftDelim  => self.string[ ldpos, (extrapos-ldpos) ],
                :delimText  => self.string[ strpos, (rdpos-strpos) ],
                :rightDelim => self.string[ rdpos, (self.pointer-rdpos) ],
                :suffix     => self.string[ self.pointer.. -1 ],
            }

        else
            raise MatchFailure,
                "No quotelike operator found after prefix at '%s...'" %
                    self.rest[0,20].chomp
        end

        
        debugMsg 1, "matchQuotelike succeeded: %s" % rval.inspect
        return rval
    end