I am trying to write a regular expression in JavaScript. I need to validate name and version, with the following conditions:
Name:
- Only alphabets, No numbers and special characters
- No trailing spaces at start or end, and no multiple spaces between words.
- Minimum of 3 and Maximum of 50 characters.
Version:
- Format should be
[number].[number].[number]
- Only a single dot between numbers (
1.3..4
is invalid,1.3.4
is ok) - Each number can be of 1 or 2 digits, like
1.11.26
(valid), but not2.343.23
(Invalid)