Fix nonsensical RegEx for name restriction (#34375)
* Fixed nonsense RegEx "-" character is a range, caused an error. No need for "," to repeat so much, it's not a separator. "\\" - just why? * Further optimized RegEx structure Added: "@" delimiter for consistency "/" to escape "-" for good and to avoid further problems
This commit is contained in:
@@ -25,7 +25,7 @@ namespace Content.Shared.Preferences
|
||||
[Serializable, NetSerializable]
|
||||
public sealed partial class HumanoidCharacterProfile : ICharacterProfile
|
||||
{
|
||||
private static readonly Regex RestrictedNameRegex = new("[^A-Z,a-z,0-9, ,\\-,']");
|
||||
private static readonly Regex RestrictedNameRegex = new(@"[^A-Za-z0-9 '\-]");
|
||||
private static readonly Regex ICNameCaseRegex = new(@"^(?<word>\w)|\b(?<word>\w)(?=\w*$)");
|
||||
|
||||
public const int MaxNameLength = 32;
|
||||
|
||||
Reference in New Issue
Block a user