I need help getting a regex to work better. My original "junk source" consists of
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 likewindow.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 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?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 .................
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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |