I have a requirement to accept the first name as input and check that the first letter is a header and that there can be 1 space after the end of the line.
This RegEx works for 'Bob':
^[A-Z][A-Za-z\p{L}]+[\s,.'\-]?[a-zA-Z\p{L}]*$
An additional requirement is to allow any language / character, which then includes the ability to use unicode.
This RegEx works for the Russian name: 'Athanasius'
^[A-Z\p{L}][A-Za-z\p{L}]+[\s,.'\-]?[a-zA-Z\p{L}]*$
... However, although it allows the use of unicode, it also allows me to enter "bob" with the first small letter, and RegEx allows this through.
Is there a way to allow both unicode and still mark the first letter when it is not capital? (Using RegEx)
, , RegEx .