* 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
[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;