The best way in my opinion would be to write a datatype extension in which you would extend one of the common datatypes, for example ezstring, and where you provide customized validation. This is mostly PHP work and to do that you have to know how to create your own datatype. This will be little work, though, as you will be extending an existing type, you will only need to provide a new unique name for it and new validation method. Naturally, it would be even better to create entirely new type.
If you make direct changes to the existing ezstring type, you will not be able to use that type anywhere else.
Here's some more hints: http://ez.no/ezpublish/documentation/development/extensions/datatypes