you could use this
i don't like the idea of dynamically changing the restrict property though.
you'll probably have to listen for the textInput or changing event and then manually test your regex and adjust the textinput.text property as appropriate.
from the adobe docs for changing event
Dispatched before a user editing operation occurs. You can alter the operation, or cancel the event to prevent the operation from being processed.