How do i 301 redirect any URL that begins having a number between 1 - 9999, for instance

domain.com/12/something/anotherthing

domain.com/378/product/icons

domain.com/2560

RewriteCond %{REQUEST_URI} ^/([0-9]+)/?(.*)
RewriteRule (.*) http://domain.com

Should work although not examined, I possibly could be stopping some .htaccess rules here.