BF2Statistics.Validator.IsValidPrefix C# (CSharp) Method

IsValidPrefix() public static method

public static IsValidPrefix ( string line ) : bool
line string
return bool
        public static bool IsValidPrefix(string line)
        {
            return Regex.IsMatch(line, @"^[a-z0-9._=-\[\]]*$", RegexOptions.IgnoreCase);
        }

Usage Example

 private void SnapshotPrefix_Validating(object sender, CancelEventArgs e)
 {
     if (!Validator.IsValidPrefix(SnapshotPrefix.Text))
     {
         MessageBox.Show("Invalid format for Snapshot Prefix. Must only characters: ( a-z0-9._-=[] )!", "Validation Error");
     }
 }