Disable button if regex does not pass

Hello!!

Is it possible to disable a button if the regex for a text input does not pass?

Thank you!