You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.8 KiB
42 lines
1.8 KiB
package pain
|
|
|
|
import (
|
|
"regexp"
|
|
)
|
|
|
|
var (
|
|
ISODateTime = regexp.MustCompile(`\d{4}(-\d\d){2}T\d\d(:\d\d){2}`)
|
|
RestrictedIdentificationSEPA1 = regexp.MustCompile(`([A-Za-z0-9]|[\+|\?|/|\-|:|\(|\)|\.|,|'| ]){1,35}`)
|
|
RestrictedIdentificationSEPA2 = regexp.MustCompile(`([A-Za-z0-9]|[\+|\?|/|\-|:|\(|\)|\.|,|']){1,35}`)
|
|
Max15NumericText = regexp.MustCompile(`[0-9]{1,15}`)
|
|
RestrictedDecimalNumber = regexp.MustCompile(`[+-]?\d+\.\d\d`)
|
|
Max70Text = regexp.MustCompile(`.{1,70}`)
|
|
|
|
ServiceLevelSEPACode = regexp.MustCompile(`SEPA`)
|
|
SequenceType1Code = regexp.MustCompile(`FRST|RCUR|FNAL|OOFF`)
|
|
PaymentMethod2Code = regexp.MustCompile(`DD`)
|
|
LocalInstrumentSEPACode = regexp.MustCompile(`CORE|B2B`)
|
|
|
|
IBAN2007Identifier = regexp.MustCompile(`[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}`)
|
|
RestrictedPersonIdentifierSEPA = regexp.MustCompile(`[a-zA-Z]{2,2}[0-9]{2,2}([A-Za-z0-9]|[\+|\?|/|\-|:|\(|\)|\.|,|']){3,3}([A-Za-z0-9]|[\+|\?|/|\-|:|\(|\)|\.|,|']){1,28}`)
|
|
BICIdentifier = regexp.MustCompile(`[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}`)
|
|
)
|
|
|
|
var (
|
|
SEPARegexps = map[string]*regexp.Regexp{
|
|
"BIC": BICIdentifier,
|
|
"CreDtTm": ISODateTime,
|
|
"CtrlSum": RestrictedDecimalNumber,
|
|
"IBAN": IBAN2007Identifier,
|
|
"Id": RestrictedPersonIdentifierSEPA,
|
|
"MsgId": RestrictedIdentificationSEPA1,
|
|
"NbOfTxs": Max15NumericText,
|
|
"Nm": Max70Text,
|
|
"PmtInfId": RestrictedIdentificationSEPA1,
|
|
"PmtMetaLclInstrm": LocalInstrumentSEPACode,
|
|
"PmtMetaSvcLvl": ServiceLevelSEPACode,
|
|
"PmtMtd": PaymentMethod2Code,
|
|
"ReqdColltnDt": ISODateTime,
|
|
"SeqTp": SequenceType1Code,
|
|
}
|
|
)
|
|
|