Make it possible to use Root as a regexp

When your templates are in several directories, with this change, you can use a regexp as root.
Therefore is it possible to make a regex to remove several directories instead of only one.