I have a text file with multiple records each with a new line like below
username ="Test1" :[Jul 01 2012]
username ="Test2" :[Jul 03 2011]
username ="Test3" :[Jul 28 2011]
username ="Test4" :[Jul 12 2010]
How do I parse through this text with the above format and only store the data between the two square brackets? [] so the result returned would look like this.
Jul 01 2012
Jul 03 2011
Jul 28 2011
Jul 12 2010
I would like to use JavaScript only to accomplish this task.
Thank you in advance for any support!
Loop through each line, and parse out the data you want. RegExes should work well here.
Let’s say your string is in the variable
myText:DEMO: http://jsfiddle.net/Uqaj9/