On the Internet, I found very useful class, using which I can restrict TextField. I encountered a problem, where my TextField can contain only one \'.\' character. I suspect
{[0-9]+\\.[0-9]+}
to match any number if this is in fact what you are wanting to do