-
-
Save stgogm/32b54c4a5d00e73dedb2 to your computer and use it in GitHub Desktop.
/^([a-z\u00C0-\u02AB'´`]{1,}\.?\s?)([a-z\u00C0-\u02AB'´`]?\.?\s?)+$/i |
Hi, your regex worked pretty well for me amongst others and thus I wanted to thank you; I only have one problem, how can I avoid a single quote character (') to pass the regex?
-Edit:
I've done some research since I'm not so experienced with regex and I think I solved some problems for me with this modified version:
/^((?!.*[\u00D7\u00F7\u01C0-\u01C3])[a-z\u00C0-\u02AF´]{1,}\s?)((?!.*[\u00D7\u00F7\u01C0-\u01C3])[a-z\u00C0-\u02AF'´
]?\s?)+$/i;
I have excluded the special caracters × ÷ ǀ ǁ ǂ ǃ that where inside the range of unicode 00C0-02AB, I've extended the latter range until 02AF to match the end of the unicode group and I've removed the single quote character form the first word (in this way I've resolved the case of a single quote passing the regex but for someone may not be good because it blocks the names starting with a single quote).
Regards.
Validates "real" person names (please see https://stackoverflow.com/questions/9445334/javascript-regex-valid-name).
These will be valid
These will be invalid