High-harmonic generation is a universal response of matter to strong femtosecond laser fields, coherently upconverting light to much shorter wavelengths. Optimizing the conversion of laser light into soft x-rays typically demands a trade-off between two competing factors. Because of reduced quantum diffusion of the radiating electron wave function, the emission from each species is highest when a short-wavelength ultraviolet driving laser is used. However, phase matching--the constructive addition of x-ray waves from a large number of atoms--favors longer-wavelength mid-infrared lasers. We identified a regime of high-harmonic generation driven by 40-cycle ultraviolet lasers in waveguides that can generate bright beams in the soft x-ray region of the spectrum, up to photon energies of 280 electron volts. Surprisingly, the high ultraviolet refractive indices of both neutral atoms and ions enabled effective phase matching, even in a multiply ionized plasma. We observed harmonics with very narrow linewidths, while calculations show that the x-rays emerge as nearly time-bandwidth-limited pulse trains of ~100 attoseconds