Files
UnrealEngineUWP/Engine/Source/Programs/nDisplayLauncher/Other/ValidationRules.cs
Ryan Durand 9ef3748747 Updating copyrights for Engine Programs.
#rnx
#rb none
#jira none

#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869242 in //Fortnite/Release-12.00/... via CL 10869536
#ROBOMERGE-BOT: FORTNITE (Main -> Dev-EngineMerge) (v613-10869866)

[CL 10870955 by Ryan Durand in Main branch]
2019-12-26 23:01:54 -05:00

53 lines
1.2 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using System.Text.RegularExpressions;
namespace nDisplayLauncher
{
public static class ValidationRules
{
public static bool IsName(string value)
{
return Regex.IsMatch(value, "^[\\w]*$") && !string.IsNullOrEmpty(value);
}
public static bool IsNameNullable(string value)
{
return Regex.IsMatch(value, "^[\\w]*$");
}
public static bool IsFloat(string value)
{
return Regex.IsMatch(value, "^[-??\\d]*(?:\\.[0-9]*)?$") && !string.IsNullOrEmpty(value);
}
public static bool IsFloatNullable(string value)
{
return Regex.IsMatch(value, "^[-??\\d]*(?:\\.[0-9]*)?$");
}
public static bool IsInt(string value)
{
return Regex.IsMatch(value, "^[\\d]*$") && !string.IsNullOrEmpty(value);
}
public static bool IsIntNullable(string value)
{
return Regex.IsMatch(value, "^[\\d]*$");
}
public static bool IsIp(string value)
{
return Regex.IsMatch(value, "^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$") && !string.IsNullOrEmpty(value);
}
//is strin value address word@IpAddress
public static bool IsAddress(string value)
{
return Regex.IsMatch(value, "^\\w*@[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$");
}
}
}