1. DSwiss
  2. Good to Know

SecureExchange - Input Field Validation

Overview

Input field validation ensures that user input meets specific criteria before processing. It's crucial for data integrity, user experience, and security. This following article outlines the basic input fields & validation within the SecureExchange platform.

Input Fields

 
Field name Required Min Max Regex Notes
first name Check Mark 1 64   no white space first name e.g.: " "
last name  Check Mark 1 64   no white space last name e.g.: " "
mobile number Check Mark 9 14 ^[\d\s]{9,14}$

EMP Frontend regex compatible with global one (column `regex`):

/^0?[1-9][\d\s]{9,13}$/

optional leading 0 is removed before sent to backend.

mobile country code Check Mark 1 10 ^\+?\d{1,10}$

+ is optional, 1-10 digits allowed

EMP Frontend regex compatible with global one (column `regex`):

/^\+\d{1,10}$|^(00)\d{1,8}$/

mobile number with country prefix Check Mark 10 50 ^(\+|00)([1-9])([-\s().]*\\d[-\s().]*){7,21}$

always starts with + or 00

then non-zero one digit 1-9

then number with the length 7 to 21

number can include any number of special characters.

Whole size is max 50

username  Check Mark 4 50 ^\S+$ no white space username allowed e.g.: " "
password Check Mark 12 255    
secureexchange name Check Mark 4 123 no Control And Special Characters
/^[^\x7F\x00-\x1F/\\:*?"<>|]*$/
no white space name allowed e.g.: " "
secureexchange description Check Mark 1 1024   no white space description allowed e.g.: " "
(first login and change) password & confirm password Check Mark 12 255   no white space password allowed e.g.: " "
change password current password Check Mark 1    

no white space password allowed e.g.: " "

no max limit, because it is not sent to the backend

login username Check Mark 1     no max limit, because it is not sent to the backend
login password Check Mark 1    

no white space password allowed e.g.: " "

no max limit, because it is not sent to the backend

languageCode Check Mark 2 2   N/A, as it is a selection box → no user input text
file & folder name Check Mark 1 128

for folder names:

  • no Control And Special Characters

^[^\\p{Cntrl}/\\\\:\\*\\?\"<>|]*$

  • no dot or double dot

/^(?!(\.+\/)|\.\s+$|\.+$).*$/

for folders:

  • no only white space text allowed e.g.: " "

  • no dot or double dot

  • no duplicated folder names

  • no space at the start and end