Need to write regular expression in javascript on a field with constraint -
The name can be up to 80 characters long. It must begin with a word character, and it must end with a word character or with ''. The name may contain word characters or '.', '-', ''."
Example -
Allowed strings -
abc.'
abc-'.'
ab-.''-a
Not allowed strings -
rish a
rish.-
What I have tried so far:
!/^[A-Za-z.-'']{1,80}$/.test(Name)
What I have tried so far:and how is that not doing what you want?