mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-27 20:41:54 +00:00
added new cabac value
This commit is contained in:
34
MediaBrowser.Server.Implementations/Connect/Validator.cs
Normal file
34
MediaBrowser.Server.Implementations/Connect/Validator.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.Connect
|
||||
{
|
||||
public static class Validator
|
||||
{
|
||||
static Regex ValidEmailRegex = CreateValidEmailRegex();
|
||||
|
||||
/// <summary>
|
||||
/// Taken from http://haacked.com/archive/2007/08/21/i-knew-how-to-validate-an-email-address-until-i.aspx
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static Regex CreateValidEmailRegex()
|
||||
{
|
||||
string validEmailPattern = @"^(?!\.)(""([^""\r\\]|\\[""\r\\])*""|"
|
||||
+ @"([-a-z0-9!#$%&'*+/=?^_`{|}~]|(?<!\.)\.)*)(?<!\.)"
|
||||
+ @"@[a-z0-9][\w\.-]*[a-z0-9]\.[a-z][a-z\.]*[a-z]$";
|
||||
|
||||
return new Regex(validEmailPattern, RegexOptions.IgnoreCase);
|
||||
}
|
||||
|
||||
internal static bool EmailIsValid(string emailAddress)
|
||||
{
|
||||
bool isValid = ValidEmailRegex.IsMatch(emailAddress);
|
||||
|
||||
return isValid;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user