Validation Regexes

Introduction to Validation Regexes

To ensure data consistency and compliance, we are implementing stricter validation rules for certain fields within our API. This involves restricting the character sets allowed for specific objects, as detailed below.


First/middle/last name for Individual End User

first name
        ^[a-zA-Z](?:[a-zA-Z '.-]*[a-zA-Z])?\.?$

last name
        ^'?[a-zA-Z]([ a-zA-Z'-]*[a-zA-Z])?$

middle name
        ^[a-zA-Z](?:[a-zA-Z '.-]*[a-zA-Z])?\.?$

Address for Individual and Business End User

address line1 (the same for line2)
         ^[a-zA-Z0-9 .'\-/,)(⁰°#"]*[a-zA-Z0-9]+[a-zA-Z0-9 .'\-/,)(⁰°#"]*$

city
        ^[a-zA-Z0-9 .'\-/,]*[a-zA-Z0-9]+[a-zA-Z0-9 .'\-/,]*$

state
        ^[a-zA-Z0-9 .'\-/,)(+]*[a-zA-Z0-9]+[a-zA-Z0-9 .'\-/,)(+]*$

postal code (for Countries NOT in (BG, EE, IE))
        ^[a-zA-Z\d][a-zA-Z\s\d\-]{1,8}[[a-zA-Z]\d]$

Registration/trading address for Business End User regex is the same as for regular address.


Company/trading name for Business End User

[a-zA-Z0-9\s',£€¥'':/«»"".?\-+()]+

Payee name:

^[ a-zA-Z0-9.'\-/&]+$

Important: Failure to adhere to these validation rules may result in issues during account creation.


Summary of the Differences between End User Names Regexes and Payee Name Regex

FeatureEnd User Name RegexesPayee Name Regex
Starting CharacterMust start with a letter (except last name)Can start with space, letter, digit, or allowed character
Ending CharacterMust end with a letter (optional period allowed)Can end with any allowed character
Allowed Charactersspace, apostrophe, period, hyphen, lettersspace, letters, digits, period, apostrophe, hyphen, /, , &
DigitsNot allowedAllowed
Forward slashNot allowedAllowed
AmpersandNot allowedAllowed
Optional Starting CharLast name allows optional apostrophe at the beginningNot applicable