Validation pattern codes for matching payment references
A regular expression (regex) is a sequence of characters that defines a specific pattern used to search patterns in text. Regex is commonly used for pattern matching, input validation, text transformation, and querying. When working with payment references in Continia Banking, regular expressions help define and validate the structure of the incoming reference strings. This is especially useful when dealing with various standardized formats such as FIK or SCOR references.
This guide covers how FIK and SCOR regex patterns are structured and offers additional examples of commonly used validation patterns
FIK reference
The following example provides a pattern that matches the references exactly.
Sample string:
71/000000001032259
Regex pattern:
^71\/(?!0{14})\d{14}\d$
Explanation:
| Pattern | Description | 
|---|---|
^ | Anchors the expression to the start of the string. | 
71/ | Matches the literal prefix 71/, which is fixed. | 
(?!0{14}) | A negative lookahead that ensures the next 14 characters are not all zeroes. | 
\d{14} | Matches exactly 14 digits. | 
\d | Matches one additional digit, usually a check digit. | 
$ | Anchors the expression to the end of the string. | 
This pattern ensures:
- The reference starts with 
71/. - The main body isn’t all zeroes.
 - The total number of digits after the slash is 15.
 - The string matches the expected structure exactly - no more, no less.
 
SCOR reference
The SCOR reference begins with RF, followed by 2 digits, then up to 21 alphanumeric characters. The following pattern enforces the required RF prefix and check digits, and allows a flexible range of characters afterward.
Sample string:
RF18539007547034
Regex pattern:
^RF\d{2}[0-9A-Za-z]{1,21}$
Explanation:
| Pattern | Description | 
|---|---|
^ | Anchors the expression to the start of the string. | 
RF | Matches the literal characters RF. | 
\d{2} | Matches exactly 2 digits. | 
[0-9A-Za-z]{1,21} | Matches between 1 and 21 alphanumeric characters (digits and letters, upper or lowercase). | 
$ | Anchors the expression to the end of the string. | 
This pattern allows flexible but valid SCOR references by:
- Requiring the 
RFprefix and 2 check digits. - Allowing a wide range of characters afterward.
 - Limiting the length to a maximum of 21 characters.
 
Additional regex examples for validation patterns
These patterns can be used for other types of payment references or as templates for custom validation:
| Example | Regex Pattern | Matches | Notes | 
|---|---|---|---|
| Exactly 10 digits | ^\d{10}$ | "1234567890" | Use for fixed-length numeric references | 
| 8–12 digits | ^\d{8,12}$ | "12345678" or "123456789012" | Flexible-length numeric references | 
| Alphanumeric, exactly 15 characters | ^[A-Z0-9]{15}$ | "INV2024ABC12345" | Uppercase letters and digits only | 
| Optional prefix with numbers | ^(INV-?)?\d{6,10}$ | "INV-123456" or "123456789" | Supports optional invoice prefix | 
| Any non-empty text | .+ | "ANYTEXT" | Flexible validation when only presence is required | 
Related information
Setting up a payment reference rule
Default payment reference rules
Configuring check digit validation
Payment reference rule examples
Payment reference rules FAQ