How do I match French and Russian Cyrillic alphabet characters with a regular expression? I only want to do the alpha characters, no numbers or special characters. Right now I have
[A-Za-z]
How do I match French and Russian Cyrillic alphabet characters with a regular expression? I only want to do the alpha characters, no numbers or special characters. Right now I have
[A-Za-z]
It depends on your regex flavor. If it supports Unicode character classes (like .NET, for instance),
\p{L}
matches a letter character (in any character set).If your regex flavour supports Unicode blocks, you can match Russian (Cyrillic) characters with:
Otherwise try:
Explanation:
Note:
Unicode Characters list and Numeric HTML Entities of
[U+0400–U+04FF]
.To match only Russian Cyrillic characters use:
which is the equivalent of:
where
А
is Cyrillic, not Latin. (Despite looking the same they have different codes)\p{IsCyrillic}
,\p{Cyrillic}
,[\u0400-\u04FF]
which others suggested will match all variants of Cyrillic, not only Russianthis worked for me
If you use modern PHP version - just:
Don't forget the u flag for unicode support!
Regex to match cyrillic alphabets with normal(english) alphabets :
It matches special chars,cyrillic alphabets,english alphabets.