using System.Text.RegularExpressions;
public static void Main()
Console.WriteLine(GetUserIdNumeric("¡?00IOuuuy&%5543)00"));
public static string GetUserIdNumeric(string userId)
char[] alpha = "WJKDQREFGLMNUVIYTXBCHZOPSA".ToCharArray();
System.Text.StringBuilder userIdNumeric = new();
string cleanUserId = Regex.Replace(userId, @"[^0-9A-Za-z]", string.Empty);
cleanUserId = cleanUserId.ToUpper();
foreach (char l in cleanUserId)
int indexFound = Array.IndexOf(alpha, l);
if (indexFound == -1) userIdNumeric.Append(l);
else userIdNumeric.Append(indexFound);
return userIdNumeric.ToString();