I want to design an expression for not allowing whitespace at the beginning and at the end of a string, but allowing in the middle of the string.
The regex I\'ve tri
How about:
^\S.+\S$
This will match any string that doesn't begin or end with any kind of space.