lib/cmsTxtToIntObj.js
function separateSections(data) {
    //Separated regular expression into many distinct pieces

    //specical metaMatchCode goes first.

    // 1st regular expression for meta, need to do
    var metaMatchCode = '^(-).[\\S\\s]+?(\\n){2,}'; //this isn't used anywhere...

    /* 2nd regular expression for claims, because the structure of claims is
  unique */
    var claimsHeaderMatchCode = '(-){4,}(\\n)*Claim Summary(\\n){2,}(-){4,}';
    var claimsBodyMatchCode = '([\\S\\s]+Claim[\\S\\s]+)+';
    var claimsEndMatchCode = '(?=((-){4,}))';
    var claimsMatchCode = claimsHeaderMatchCode +
        claimsBodyMatchCode + claimsEndMatchCode;

    //this match code is for all other sections
    var headerMatchCode = '(-){4,}[\\S\\s]+?(\\n){2,}(-){4,}';
    var bodyMatchCode = '[\\S\\s]+?';
    var endMatchCode = '(?=((-){4,}))';
    var sectionMatchCode = headerMatchCode + bodyMatchCode + endMatchCode;

    /* The regular expression for everything, search globally and
  ignore capitalization */
    var totalMatchCode = claimsMatchCode + "|" + sectionMatchCode;
    var totalRegExp = new RegExp(totalMatchCode, 'gi');
    var matchArray = data.match(totalRegExp);
    return matchArray;
}
function separateSections(data) {
    //Separated regular expression into many distinct pieces

    //specical metaMatchCode goes first.

    // 1st regular expression for meta, need to do
    var metaMatchCode = '^(-).[\\S\\s]+?(\\n){2,}'; //this isn't used anywhere...

    /* 2nd regular expression for claims, because the structure of claims is
  unique */
    var claimsHeaderMatchCode = '(-){4,}(\\n)*Claim Summary(\\n){2,}(-){4,}';
    var claimsBodyMatchCode = '([\\S\\s]+Claim[\\S\\s]+)+';
    var claimsEndMatchCode = '(?=((-){4,}))';
    var claimsMatchCode = claimsHeaderMatchCode +
        claimsBodyMatchCode + claimsEndMatchCode;

    //this match code is for all other sections
    var headerMatchCode = '(-){4,}[\\S\\s]+?(\\n){2,}(-){4,}';
    var bodyMatchCode = '[\\S\\s]+?';
    var endMatchCode = '(?=((-){4,}))';
    var sectionMatchCode = headerMatchCode + bodyMatchCode + endMatchCode;

    /* The regular expression for everything, search globally and
  ignore capitalization */
    var totalMatchCode = claimsMatchCode + "|" + sectionMatchCode;
    var totalRegExp = new RegExp(totalMatchCode, 'gi');
    var matchArray = data.match(totalRegExp);
    return matchArray;
}
function separateSections ( data ) { //Separated regular expression into many distinct pieces //specical metaMatchCode goes first. // 1st regular expression for meta, need to do var metaMatchCode = '^(-).[\\S\\s]+?(\\n){2,}' ; //this isn't used anywhere... /* 2nd regular expression for claims, because the structure of claims is
  unique */ var claimsHeaderMatchCode = '(-){4,}(\\n)*Claim Summary(\\n){2,}(-){4,}' ; var claimsBodyMatchCode = '([\\S\\s]+Claim[\\S\\s]+)+' ; var claimsEndMatchCode = '(?=((-){4,}))' ; var claimsMatchCode = claimsHeaderMatchCode + claimsBodyMatchCode + claimsEndMatchCode ; //this match code is for all other sections var headerMatchCode = '(-){4,}[\\S\\s]+?(\\n){2,}(-){4,}' ; var bodyMatchCode = '[\\S\\s]+?' ; var endMatchCode = '(?=((-){4,}))' ; var sectionMatchCode = headerMatchCode + bodyMatchCode + endMatchCode ; /* The regular expression for everything, search globally and
  ignore capitalization */ var totalMatchCode = claimsMatchCode + "|" + sectionMatchCode ; var totalRegExp = new RegExp ( totalMatchCode , 'gi' ) ; var matchArray = data . match ( totalRegExp ) ; return matchArray ; }
Parses string into sections, then returns the array of strings for each section
Parses string into sections then returns the array of strings for each section