Use the query as follows:
SELECT myfield::integer FROM mytable WHERE myfield ~ E'^\\d+$';
In Postgres, you can't get any non-integers hitting your:: integer cast. It is also used to handles NULL values (but, they won't match the regexp). But, if you want zeros instead of not selecting, then use the CASE statement like this:
SELECT CASE WHEN myfield~E'^\\d+$' THEN myfield::integer ELSE 0 END FROM mytable;