I want to restrict the user from entering a tab in a text field using regular expression.
It will check 2 or more spaces You could also check that before and after those spaces words follow. (not other whitespace like tabs or new lines)
The same, but you can also pick (capture) only the spaces for tasks like replacement
or see that before and after spaces there is anything, not only word characters (except whitespace)
To be specific about Tab, you can use. It will check 1 or more that once tab