I am currently trying to create a JavaScript regular expression using the following conditions:
- Accepts all UTF-8 characters
- A space between words is allowed as soon as 1 space, not several.
- Allow all characters, for example :! # $% ^ & * () _- = {} [] except: "@"
- No spaces after or before the line.
- The range must be 2-16 characters, including spaces
- And must contain at least two alphabetic characters per line.
Here is the Regex I have compiled so far:
/^(?![^@]*@)(?![^]*\s\s)\S[^]{0,14}\S$/
Until now, this has done all of the above, except that it does not meet the last condition, which consists in the fact that it must contain at least two letters. For example:
"..He" //should be true
"He$*" //should be true
".." //should be false
"*%" //should be false
"!#$%^&*()" //should be false since there is no letters
"$$tonyMoney™" //should be true
"أنا أحب جاف™" //should be true
"To" //should be true
Any help is appreciated! Thanks!