I was trying to understand the following regex
^(?!\s)(?!.*\s\s)[ A-Za-z0-9'-]{1,35}(?<!\s)$
Here I understood,
^(?!\s)
- (lookahead) means will not match if there is a leading space.
[ A-Za-z0-9'-]{1,35}
- will allow A to Z, a to z, 0 to 9, (space), ' and -.
(?<!\s)$
- means will not match if there is a trailing space.
I am unable to understand what this sub-expression is doing?
(?!.*\s\s)