Hello can someone please help improve the regex I have:

/^[^\s].*[^\s]$/

It's intended to be used for a nickname field with the following criteria:

> no spaces

> exclude the following words(substring ) within the nickname: 'anonymous', 'xxx', 'yyy'

> just allow letters, numbers, hyphens and underscores eg. exclude characters such as @, #, !, ~, %, ^, *, (, ), =,...