copy method on regular expressions returns the correct subclass.