UNPKG

docparse-supplier-nge

Version:

process ngrid electric utility bill data for use in the docparse system

31 lines (30 loc) 865 B
module.exports = function(text) { var pattern = /[\s\S]*(Other Charges[\s\S]*Total Other Charges.*$)/m; var matches = text.match(pattern); if (!matches || matches.length !== 2 || !matches[1]) { // no supplier charges whatsoever, let alone other charges return null; } return matches[1].replace(/[$,]/g,''); } /** * Anachors we have seen before for other charges are as follows: var items = [ 'Canceled Electric Charges', 'Late Payment', 'LPC Strategic Energy', 'General Credit', 'Enhanced Meter Monthly', 'Transfer Credit/Charges', 'Market Price Adjustment', 'Sales Tax', 'LPC Hess Corp', 'New Installation Charge', 'Refunded Amount', 'Debit Transfer Payment', 'Deposit Credit', 'NextEra Energy Services MA LLC', 'Energy Efficiency Project CoPay', 'Energy Profiler Online' ] */