How to extend the registration form?

I want to create a plugin to extend the registration form. Specificaly I want to add three extra fields, one for country, one for postal code and one for telephone number. I know that this can be done with the Profile Manager plugin. But I also want to do some custom validation in those fields. For example based on selected country a custom validation for the telephone. 

Is there any example of how to create a plugin that extends the registration form?

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking