From 3903f5e8815bdf73ad50dadfd2efe9400ca0a3bf Mon Sep 17 00:00:00 2001 From: Edgar Toll Date: Mon, 2 Jan 2017 01:00:48 +0100 Subject: [PATCH] Fix a possible issue with items in pasted contracts --- src/app/item-estimator/parse-item-line.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/item-estimator/parse-item-line.service.ts b/src/app/item-estimator/parse-item-line.service.ts index 844c0ac..b7fc3fe 100644 --- a/src/app/item-estimator/parse-item-line.service.ts +++ b/src/app/item-estimator/parse-item-line.service.ts @@ -16,7 +16,7 @@ const AmountNameRegexList: RegExp[] = [ CargoScannerRegex ]; -const ContractRegex = new RegExp('^' + ItemNamePart + SeperatorPart + NumberPart + SeperatorPart + ItemNamePart + SeperatorPart + ItemNamePart + '(?:' + SeperatorPart + ItemNamePart + ')' + '$'); // not perfect but it works for the name/ amount detection +const ContractRegex = new RegExp('^' + ItemNamePart + SeperatorPart + NumberPart + SeperatorPart + ItemNamePart + SeperatorPart + ItemNamePart + '(?:' + SeperatorPart + ItemNamePart + ')?' + '$'); // not perfect but it works for the name/ amount detection const InventoryRegex = new RegExp('^' + ItemNamePart + SeperatorPart + NumberPart + SeperatorPart + ItemNamePart + SeperatorPart + PossibleSingleWordPart + PossibleSingleWordPart + FractionNumberPart + ' m3' + '$'); const ItemInfoReprocessedMaterialsRegex = new RegExp('^' + ItemNamePart + SeperatorPart + '\\(' + NumberPart + ' Units?\\)' + '$'); const ShipFittingChargesRegex = new RegExp('^' + ItemNamePart + ' x' + NumberPart + '$');