module.exports = (function () {

  var
    fs = require( 'fs' ),
    // http://stackoverflow.com/q/1068308 / https://github.com/jxson/front-matter
    regex = /^(\s*\{\{\{([\s\S]+)\}\}\}\s*)/gi,
    attributes, body;
    
  function parseFile ( path, callback ) {
    fs.readFile( path, 'utf-8', function ( err, data ) {
      callback( err, parseString( data ) );
    });
  }

  function parseString ( data ) {
    if ( !data ) { return {} };
    var match = regex.exec( data );
    if ( match && match.length ) {
      attributes = JSON.parse( '{' + match[ 2 ].replace(/^\s+|\s+$/g, '') + '}' );
      body = data.replace( match[ 0 ], '' );
    } else {
      attributes = {};
      body = data;
    }
    return { attributes: attributes, body: body };
  }

  return {
    parseFile : parseFile,
    parse     : parseString
  };

})();

@@ -195,26 +195,26 @@
 %0A    attribu
-t
 e
+t
 s, body;%0A   
@@ -697,16 +697,41 @@
 ;%0A    %7D%0A
+    regex.lastIndex = 0;%0A
     retu

Reset regex lastIndex after use