Just try `expect("foo").to match(/bar/)`, see how it fails, and then pick a representative part of it to pass to `fail_with` as a regex.