serializer: support regular expressions (close #26)