How can I add a custom validation in the Input plugin

I am writing a new plugin and I want to add a custom validation for a text field to check for a particular format and display in the UI itself before saving the Input. Is there any way to do this check ?

please do not post the same question twice

When someone can answer your question you will get an answer posting the same multiple times does not help.

I close this now.