aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/NumericCharacterValidation.cs
blob: d72b68eae3e1e5f13c1429b99399ca6ff32972a4 (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 NumericCharacterValidation
    {
        public static bool IsNumeric(char value)
        {
            Regex regex = NumericRegex();

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

        [GeneratedRegex("[0-9]|.")]
        private static partial Regex NumericRegex();
    }
}