My target is to improve my regex. Regex need to everything except some special charaters, not to allow empty spaces at start, and not to allow empty spaces at the end.
^(?!\s*$)[^-\s][^`=~!@#$%^&*()[\]\/\\{}"|<>?]{3,100}$
Example:
word
valid
word [space]
invalid
[space] word
invalid
word w
valid
My regex did everything except empty space at the end. How to add this condition to forbit empty spaces at the end of regex?