# File lib/Getopt/DelimScanner.rb, line 343
    def scanTagged( opentag=nil, closetag=nil, prefix='\s*', options={} )
        prefix ||= '\s*'

        ldel = opentag || %Q,<\\w+(?:#{ makeDelimPattern(%q:'":) }|[^>])*>,
        rdel = closetag
        raise ArgumentError, "Options argument must be a hash" unless options.kind_of?( Hash )

        failmode    = options[:fail]
        bad     = if options[:reject].is_a?( Array ) then
                      options[:reject].join("|")
                  else
                      (options[:reject] || '')
                  end
        ignore  = if options[:ignore].is_a?( Array ) then
                      options[:ignore].join("|")
                  else
                      (options[:ignore] || '')
                  end

        self.matchError = nil
        result          = nil
        startPos        = self.pointer

        depth = self.scanDepth

        begin
            result = matchTagged( prefix, ldel, rdel, failmode, bad, ignore )
        rescue MatchFailure => e
            debugMsg( depth + 1, "Match error: %s" % e.message )
            self.matchError = e.message
            self.pointer = startPos
            result = nil
        rescue => e
            self.pointer = startPos
            Kernel::raise
        end

        return result
    end