aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/CJKCharacterValidation.cs
blob: 6134a3cdd28bdb026dc734cca24263672c88e529 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
using System.Text.RegularExpressions;

namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
{
    public static partial class CJKCharacterValidation
    {
        public static bool IsCJK(char value)
        {
            Regex regex = CJKRegex();

            return regex.IsMatch(value.ToString());
        }

        [GeneratedRegex("\\p{IsHangulJamo}|\\p{IsCJKRadicalsSupplement}|\\p{IsCJKSymbolsandPunctuation}|\\p{IsEnclosedCJKLettersandMonths}|\\p{IsCJKCompatibility}|\\p{IsCJKUnifiedIdeographsExtensionA}|\\p{IsCJKUnifiedIdeographs}|\\p{IsHangulSyllables}|\\p{IsCJKCompatibilityForms}")]
        private static partial Regex CJKRegex();
    }
}