I need the following:
- No numbers
- Only allow the special characters
-
and'
- Spaces should not be allowed at the beginning or end of the field
- Remove any additional blank space if found between parts of names (allow only one space between parts of name – if multiple middle names)
- Allow diacritics
Chat GPT gave the following:
^(?!.*d)[p{L}'-]+$
However this still allows me to enter consecutive spaces.
2
Answers
OK, found the answer:
I think you could do something like that in JavaScript: