Parsing out hashes from single lines
Scenario: a sql dump file that contains multiple md5 hashes, but they are all on a single line.  The goal is to parse them out to make them readable by hashcat.

While this command is functional, it runs VERY slow.

cat md5.sql | grep -i -o -w '\w\{32\}' | grep -i -v '[g-z_]' > md5_hashes_unsorted_ununiqed.hash

Is there a faster way to parse out md5 strings from single lines that contain multiple md5 hashes?
egrep -o '[0-9a-fA-F]{32}' md5.sql > md5_hashes_unsorted_ununiqed.hash

or even better and much more correct (because otherwise you could get some false positives):

SELECT password INTO OUTFILE 'md5_hashes_unsorted_ununiqed.hash' FROM table;