Hello Friends,

I'm trying to do the following:

1. Open CSV File.

2. Parse text and search for any Base64 encoded text.

3. Take that text and decode it using the MIME::Base64 package.

4. Replace encoded text with decoded text.

I'm running into some issues here. I first tried using the Text::CSV package but found it a bit difficult to use (I'm a bit new to perl, and had issues accessing data directly in the array that text::csv created when reading the csv file).

The main issue I'm having is finding a legit way to just search the document for Base64 encoded text. I've exhausted my googling skills and have come to you gents for advice.

Anyone know of a way in which I can search a document for Base64 encoded text? I've been trying to use the following regex which I found on this forum. I have no idea how to implement it into my code....

m{ ^ (?: [A-Za-z0-9+/]{4} )* (?: [A-Za-z0-9+/]{2} [AEIMQUYcgkosw048] = | [A-Za-z0-9+/] [AQgw] == )? \z }x
If needed, I can post my code thus far. Thanks!

In reply to Searching for Base64 by horsechoker

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.