Test Unicode Letter Matching in JavaScript Regex
JavaScript Unicode property escapes can match letters across scripts. The ASCII range from A to Z covers far fewer characters. Neither alone defines a good policy for every human name or identity field.
Create synthetic cases
Use an ASCII word, a word with é, a digit and a word with a combining accent. In Ferkesh Tools Regex Tester, compare the ASCII pattern with ^\p{L}+$ using the u flag. Check the displayed match result for each input.
Compare equivalent text
An accented letter stored as one code point can match while a letter followed by a combining mark can fail a letter-only expression. Define whether NFC normalization or inclusion of appropriate marks belongs in the application. Test those decisions before using them.
Write the actual business policy
Review spaces, apostrophes and other punctuation the field should accept. Use an approved local staging fixture and avoid customer names. Treat regex as input validation. Keep account access checks separate.
Related Ferkesh Knowledge Base guides
- Convert CSV With Quoted Fields to JSON Safely
- How to Verify Text and Collation After a Database Restore
Ferkesh Tools
Official references
Last reviewed .
Obrigado pela sua opinião!