?
Solved

Base64 Error Checking

Posted on 2006-06-23
4
Medium Priority
?
172 Views
Last Modified: 2010-04-23
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?
0
Comment
Question by:sk33v3
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 23

Expert Comment

by:Jens Fiederer
ID: 16971794
You could use regular expressions.

Replace [^a-zA-Z0-0/+] with the empy string.
0
 
LVL 23

Expert Comment

by:Jens Fiederer
ID: 16971799
Make that [^a-zA-Z0-9/+]  (mistyped).
0
 
LVL 9

Author Comment

by:sk33v3
ID: 16971815
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?
0
 
LVL 23

Accepted Solution

by:
Jens Fiederer earned 2000 total points
ID: 16971897
system.Text.RegularExpressions.Regex.Replace("123#$%abc" & vbCRLF & "foo---+/bar1", _
             "[^0-9A-Za-z/+]", "", Text.RegularExpressions.RegexOptions.Singleline)


will give you:

"123abcfoo+/bar1"
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question