fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. string msg= "=?windows-1258?B?UkU6IFRyIDogUGxhbiBkZSBjb250aW51aXTpIGQnYWN0aXZpdOkgZGVz?= =?windows-1258?B?IHNlcnZldXJzIFdlYiBHb1ZveWFnZXN=?=";
  8. var charSetOccurences = new Regex(@"=\?(.*?)\?([BQ])\?(.*?)\?=", RegexOptions.IgnoreCase);
  9. MatchCollection matches = charSetOccurences.Matches(msg);
  10. foreach (Match match in matches)
  11. {
  12. Console.WriteLine("Charset: " + match.Groups[1].Value);
  13. Console.WriteLine("Encoding type: " + match.Groups[2].Value);
  14. Console.WriteLine("Encoded String: " + match.Groups[3].Value + "\n");
  15. }
  16. }
  17. }
Success #stdin #stdout 0.07s 34176KB
stdin
Standard input is empty
stdout
Charset: windows-1258
Encoding type: B
Encoded String: UkU6IFRyIDogUGxhbiBkZSBjb250aW51aXTpIGQnYWN0aXZpdOkgZGVz

Charset: windows-1258
Encoding type: B
Encoded String: IHNlcnZldXJzIFdlYiBHb1ZveWFnZXN=