I used this snippet copy a CircleCI page with a bunch of spec failures. I pasted that into foo.txt and then ran the following command to extract all of the specs that failed:
cat foo.txt | !contents.scan(/[^\s]+_spec\.rb/).sort.uniq.join(' ').gsub("'", '')