in reply to Reliable way to detect base64 encoded strings
new Regex(@"[0-9a-zA-Z\+/=]{20,}"); '(^Content-Transfer-Encoding: base64$)(^$)(^(([A-Za-z0-9+/=]){4}){1,19 +}$)*(^$)' ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ my $sanitized_str = join q{}, grep {!/[^A-Za-z0-9+\/=]/} split /\n/, $ +str;
|
|---|