Few small bugs in the MT940 @bankfile driver

Dear Invantive,
few remarks on the swift-MT940 driver (in my case bank file provided by ABN AMRO)
I’m running QueryTool 20.0.66

  • some extracted fields from the driver are sometime mistaken, when the data contains the / char;
    the / will escape the extraction thus miss the content after
  • some few sequences are not extracted at all, not being recognized by the driver. I have not been able to find why.

I wrote this regex correction in order to have a better match.

I can provide some example files if Invantive would like to dig into this.

Regards

select 
  Filename
  ,FileLineNumber
  ,StatementLineNumber
  ,StatementAccountIdentification
  ,ValueDate
  ,Amount
  --,EndToEndReference
  ,regexp_substr(InformationToAccountOwner,'(?<=\/EREF\/)(.*)($)') AS EndToEndReference
  ,ReferenceAccountOwner
  --,RemittanceInformation
  ,CASE
      WHEN regexp_substr(InformationToAccountOwner,'(?<=\/REMI\/)(.*)(?=\/EREF)|$') like '%' -- is not null
      THEN regexp_substr(InformationToAccountOwner,'(?<=\/REMI\/)(.*)(?=\/EREF)|$')
      ELSE Unparseable
      END
      AS RemittanceInformation
  --,CounterPartyIdName
  ,CASE 
      WHEN regexp_substr(InformationToAccountOwner,'(?<=\/NAME\/)(.*?)((?=\/REMI)|(?=\/EREF))') is not null
      THEN regexp_substr(InformationToAccountOwner,'(?<=\/NAME\/)(.*?)((?=\/REMI)|(?=\/EREF))') 
      ELSE CounterPartyIdName
      END
      AS Name
  --,CounterPartyIdAccountNumber
  ,CASE
      WHEN regexp_substr(InformationToAccountOwner,'(?<=\/IBAN\/)(.*)(?=\/BIC)') is not null
      THEN regexp_substr(InformationToAccountOwner,'(?<=\/IBAN\/)(.*)(?=\/BIC)')
      ELSE CounterPartyIdAccountNumber
      END
      AS Sender_IBAN
  ,Unparseable
  ,InformationToAccountOwner
from  BankStatementLines@Bankfiles