Hi Monks.

I need help getting a regex to work better. My original "junk source" consists of

window.Grid1 = new ComponentArt_Grid('Grid1'); Grid1.Data = [[33,'DOR00393','ActiveState ActivePerl 5.8.8 Build 819', +0,'Software','No','Yes','No','Yes','Yes','No','No','No','No','No'],[4 +93,'STP00A82','ActiveState Perl Dev DOR Modules 1.0',0,'Software','No +','Yes','No','Yes','No','No','No','No','No','No'],[34,'DOR00394','Act +iveState Perl Dev Kit 6.0 Pro Pack',0,'Software','No','No','No','Yes' +,'Yes','No','No','No','No','No'],[764,'','AD Group Request: Rev Repo +rts - Modify Access',1,'General','No','Yes','Yes','Yes','Yes','Yes',' +No','No','No','No'],[81,'STP0028A','Adesso Cyber Pad Software Suite 3 +.13',0,'Software','No','Yes','No','Yes','Yes','No','No','No','No','No +'],[371,'STP009FB','Adesso Cyberpad 3.14
Which the developer of the system we use didn't believe in using line breaks (making it that much more difficult to line parse. I have about 400+ records that look like this I need to parse information out of, so far I have to copy that junk code into notepad and add new lines to separate the data. The end result looks like
window.Grid1 = new ComponentArt_Grid('Grid1'); Grid1.Data = [ [33,'DOR00393','ActiveState ActivePerl 5.8.8 Build 819',0,'Software',' +No','Yes','No','Yes','Yes','No','No','No','No','No'], [493,'STP00A82','ActiveState Perl Dev DOR Modules 1.0',0,'Software','N +o','Yes','No','Yes','No','No','No','No','No','No'], [34,'DOR00394','ActiveState Perl Dev Kit 6.0 Pro Pack',0,'Software','N +o','No','No','Yes','Yes','No','No','No','No','No'], [764,'','AD Group Request: Rev Reports - Modify Access',1,'General',' +No','Yes','Yes','Yes','Yes','Yes','No','No','No','No'], [81,'STP0028A','Adesso Cyber Pad Software Suite 3.13',0,'Software','No +','Yes','No','Yes','Yes','No','No','No','No','No'], [371,'STP009FB','Adesso Cyberpad 3.14 .................
Which you can see everything pretty much ends in a comma or a ]. This extra editing before my parse is becoming tedious, can someone help me get this to work using the same junk source from above?

The information I'm pulling for each record is the id number which is the first number after the [ and the title of the program which is in the 2nd set of ''. For example..

[33,'DOR00393','ActiveState ActivePerl 5.8.8 Build 819',0,'Software',' +No','Yes','No','Yes','Yes','No','No','No','No','No'], # I would need 33 to be in $1 and ActivePerl 5.8.8 Build 819 to be in +$2

In reply to Basic regex to parse source code by Anonymous Monk

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.