Link to home
Start Free TrialLog in
Avatar of sk33v3
sk33v3

asked on

Base64 Error Checking

I am trying to find an easy way to remove any data which does not belong in a base 64 string. IE the string might look like the one below

"Hello
This is a test


please note VbCrLf's are not allowed in Base64 nor are single qoutes."

Is there an easy why just to replace all the non base 64 characters?
Avatar of Jens Fiederer
Jens Fiederer
Flag of United States of America image

You could use regular expressions.

Replace [^a-zA-Z0-0/+] with the empy string.
Make that [^a-zA-Z0-9/+]  (mistyped).
Avatar of sk33v3
sk33v3

ASKER

Sorry I am not familiar with regular expressions. I vaguely know what they are but I have not used them. Within my code how would I use that?
ASKER CERTIFIED SOLUTION
Avatar of Jens Fiederer
Jens Fiederer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial