I am looking for a regular expression to use in Swift to validate cardholder name for a credit card. I am looking for a regEx which:
- Has minimum 2 and maximum of 26 characters
- Accept dashes (
-
) and apostrophes ('
) only and no other special character - Capital and small alphabets and no numbers.
- Should not start with a blank space.
I was using this
"^[^-\\s][\\p{L}\\-'\\s]{2,26}$"
but it only accepts dash (-
) no apostrophe ('
)