I'm currently using this expression to validate at least 2 words, containing letters, "-" and "'".
It works fine until someone enters unicode special characters, like from different languages. I've checked the \p{L} option, but that does not work or I am missing just something. Any help would be nice.


Recommended Answers

All 2 Replies

Ok, so I understood this is the correct expression I have to use:\P{M}\p{M}*+,however, I'm having trouble implementing it into my example. I tried various examples, for example, /^((\b[\P{M}\p{M}]{2,40}\b)\s*){2,}$/, yet they all keep failing to validate. Does anyone have a suggestion of where exactly to put the unicode validation?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.