Q:

Reorder date format with regex

I have a lot of bank statements which are provided with the prefix DDMMYYYY. This is useless for sorting, very unintuitive (to me, anyway). 
Is there a regex expression that can reorder the name so the files are prefixed in YYYYMMDD?
Thanks in advance. I looked at some of the posts answering similar questions and found it a bit beyond me.

A:

Use capturing group.
For example, here's a javascript code:
> '09122013'.replace(/(\d{2})(\d{2})(\d{4})/, '$3$2$1')
"20131209"

