I am trying to make a JavaScript Regex which satisfies the following conditions
- a-z are possible
- 0-9 are possible
- dash, underscore, apostrophe, period are possible
- ampersand, bracket, comma, plus are not possible
- consecutive periods are not possible
- period cannot be located in the start and the end
- max 64 characters
Till now, I have come to following regex
^[^.][a-zA-Z0-9-_\.']+[^.]$
However, this allows consecutive dot characters in the middle and does not check for length. Could anyone guide me how to add these 2 conditions?