using System.Collections.Generic;
using System.Globalization;
using System.Text.RegularExpressions;
public static void Main()
string fullName = "Bpk UTJU SUHADA, BSC";
fullName = Regex.Replace(fullName, "[^a-zA-Z0-9% ._]", string.Empty);
fullName = System.Text.RegularExpressions.Regex.Replace(fullName, @"\s+", " ");
Console.WriteLine("fullName : " + fullName);
string strOne = fullName.Replace(" ", ",");
Console.WriteLine("strOne : " + strOne);
string[] strArrayOne = new string[]{""};
strArrayOne = strOne.Split(',');
string stringToCheck = "S1s1Beruang";
string password = "S1s1Beruang";
stringToCheck = stringToCheck.ToUpper();
bool isContainFullName = false;
foreach (string x in strArrayOne)
if (stringToCheck.Contains(x))
isContainFullName = true;
var hasSymbol = new Regex(@"^((?=.*\d{2})(?=.*[A-Za-z]).{8,12})$");
var isValidatedPass = hasSymbol.IsMatch(password);
Console.WriteLine("isValidatedPass : " + isValidatedPass);
Console.WriteLine("isContainFullName : " + isContainFullName);
if ((isValidatedPass == false && isContainFullName == true) || (isValidatedPass == false && isContainFullName == false) || (isValidatedPass == true && isContainFullName == true))
Console.WriteLine("Wrong Combination");
Console.WriteLine("Correct Combination");