# File lib/money/money/parsing.rb, line 36
      def parse(input, currency = nil)
        i = input.to_s.strip

        # raise Money::Currency.table.collect{|c| c[1][:symbol]}.inspect

        # Check the first character for a currency symbol, alternatively get it
        # from the stated currency string
        c = if Money.assume_from_symbol && i =~ /^(\$|€|£)/
          case i
          when /^$/ then "USD"
          when /^€/ then "EUR"
          when /^£/ then "GBP"
          end
        else
          i[/[A-Z]{2,3}/]
        end

        # check that currency passed and embedded currency are the same,
        # and negotiate the final currency
        if currency.nil? and c.nil?
          currency = Money.default_currency
        elsif currency.nil?
          currency = c
        elsif c.nil?
          currency = currency
        elsif currency != c
          # TODO: ParseError
          raise ArgumentError, "Mismatching Currencies"
        end
        currency = Money::Currency.wrap(currency)

        cents = extract_cents(i, currency)
        new(cents, currency)
      end