Configure customer data validation

276 views 0

How to configure customer data validation.

The CustomerValidation validation attribute and corresponding JavaScript code generation is backed by a configuration file where validation rules for different combinations of field type, country, product and product group can be added.

The validation rules can be written either as regular expressions or JavaScript functions.

There are some default rules that are included as embedded resources in Atomia.Common.dll, but you can override these or add new rules by changing the file C:Program Files (x86)AtomiaCommonatomiaConfigurationStore.overrides (you might need to create the file).

The easiest way is to start from a copy of the default file which can be found in the AtomiaCommon repo at AtomiaCommon/Atomia/Common/Resources/AtomiaConfigurationDefaults.txt

The default file contains explanations and examples of how to write the validation rules.

The field types below are supported by default and have been added to individual forms as would be expected from the field names, but please note that all fields in every form do not have connections to country or product and product group. This is to limit the amount of validation JavaScript that needs to be generated for each view. So even if you specify a rule for some combination with those dependencies it must be supported in the particular form to be active and evaluated there.

Default CustomerValidation field types:

  • first_name
  • last_name
  • company_name
  • address
  • city
  • email
  • zip (rules for the EU countries, the US, Canada and Argentina are added by default)
  • identity_number (represents the organization, company or personal identity number)
  • vat_number (rules for all EU countries available by default)
  • country (country code)
  • phone
  • mobile
  • fax

Defaults can be seen in the Customer validation rules file below. Override file must follow the same file formatting rules as in this file. For example, if you want changed email validation, you need to add the following line to override file:

customer_validation.email.1	 regexp	 {regexp by desire}

Both default and overrides affect all forms that have customer data editing/adding possibility.

Default customer validation rules file:

# Customer validation rules
# =========================
#
# The rules have option names like:
# customer_validation.<RuleName>.<RuleSetNo>.<CountryOption>.<ProductGroupOption>.<ProductOption>
#
# Example:
# customer_validation.zip.1.se.default.default
#
# The last three can be "default", trailing defaults can be skipped, but
# all rules for a field have to have the same number of parts in the option name
#
# <CountryOption> should correspond to the country codes as used in Billing API.
#
# <ProductGroupOption> and <ProductOption> should correspond to the HostingProduct configuration 
# attributes "productCategory" and "articalNumber" respectively.
#
# When adding rule for country validation based on <ProductGroupOption> two identical entities are needed:
# one that has product category from Product and other that has product category from Shop.
#
# Example:
# customer_validation.country.1.default.Domain.default regexp ^(RS|DK|LB)$
# customer_validation.country.1.default.TLD.default regexp ^(RS|DK|LB)$
#
# Rule Sets and Specificity
# -------------------------
#
# The numbers in option names represent a rule set. Only the most specific applicable
# rule in a rule set will be used for validation. If multiple rules should all be applicable they
# must be placed in different rule sets.
#
# Rule specificity is based firstly on the number of non-defaults and secondly on the following
# order: country is more specific than product, which in turn is more specific than product group,
# i.e. country > product > product group.
#
# If there is more than one applicable rule of the same specificity in a rule set the rule that will
# be selected is undefined.
#
# If multiple applicable rules should be applied, they must be put in different rule sets.
# Logically we have something like this Valid = (RuleSet1.RuleA || RuleSet1.RuleB) && (RuleSet2.RuleA || RuleSet2.RuleB) && ...
# E.g. DMN-SE and DMN-NU products both have the same requirements regarding identity_number, but the rules are
# independent of each other, so they are placed in different rule sets.
#
#
# Custom Fields
# ---------------
#
# Custom fields part allows specification of additional contact fields that will be requested and passed to domain contact
# when domains are ordered or contacts are assigned to them.
#
# The rules have option names like:
# custom_fields.<RuleSetNo>.<FieldName>.<CountryOption>.<ProductGroupOption>.<ProductOption>
#
# Example:
# custom_fields.1.nexus_app_purpose.default.default.DMN-US regexp.required .+
#
# Only regexp rule types are supported for custom fields.
#
#
# Required Fields
# ---------------
#
# Normally the decision whether a field should be considered required or not is defered to the place where
# the validation is initiated, e.g. by setting AtomiaRequired or Required attributes on an ASP.NET MVC model property.
#
# This means that empty values are always considered valid regardless of the rule value.
#
# In cases where there is a hard requirement, i.e. the value MUST be supplied, it is possible to override the
# default behavior by putting the rule type as 'regexp.required' or 'javascript.required'.
#
# Please note that overriding the default behavior and make a hard required field should only need to be done very rarely.
#
# Examples:
# * It is not possible to register a .se domain without supplying a Swedish corporate or personal identity number. This
# is a hard requirement.
# * A Swedish zip code always should consist of 5 digits. There could be many cases though where a zip code is not required,
# but iff one is supplied for a Swedish address, it should be validated for 5 digits. This is NOT a hard requirement.
#
#
# Replace value
# ---------------
#
# It is possible to define replacement string for regexp rules. If defined, this replacement string will be used together
# with validation regular expression in Regex.Replace(input, pattern, replacement) method where input is field value,
# patter is validation rule value and replacement is replace string.
#
# Example:
# * customer_validation.zip.1.se regexp ^([0-9]{3})s?([0-9]{2})$ (replace: $1$2)
# In this example, replace string is $1$2 which in this case will match first and second group from field value and join
# them together (i.e. string 123 45 will be replaced with 12345).

# Option name # Type # Value # Replace regexp (optional)

# Names etc.
customer_validation.first_name.1 regexp ^([^{}[]`=<>^;]*)$
customer_validation.last_name.1 regexp ^([^{}[]`=<>^;]*)$
customer_validation.full_name.1 regexp ^(?:[u00c0-u01ffa-zA-Z'-]){2,}(?:s[u00c0-u01ffa-zA-Z'-]{2,})+$
customer_validation.company_name.1 regexp ^([^{}[]`=<>^;]*)$
customer_validation.address.1 regexp ^([^{}[]`=<>^;]*)$
customer_validation.city.1 regexp ^([^{}[]`=<>^;]*)$

# Email address
customer_validation.email.1 regexp ^[a-zA-ZåÅäÄéÉöÖüÜ0-9!#$%&'*+/=?^_`{|}~-]+(?:.[a-zA-ZåÅäÄéÉöÖüÜ0-9!#$%&'*+/=?^_`{|}~-]+)*@([a-zA-ZåÅäÄéÉöÖüÜ0-9]([a-zA-ZåÅäÄöéÉÖüÜ0-9-]{0,61}[a-zA-ZåÅäÄéÉöÖüÜ0-9])?)+(.[a-zA-ZåÅäÄéÉöÖüÜ0-9]([a-zA-ZåÅäÄéÉöÖüÜ0-9-]{0,61}[a-zA-ZåÅäÄöéÉÖüÜ0-9])?)+$

# Zip, default
customer_validation.zip.1.default regexp ^[0-9]{3,10}$

# Zip, EU
customer_validation.zip.1.at regexp ^[0-9]{4}$
customer_validation.zip.1.be regexp ^[0-9]{4}$
customer_validation.zip.1.bg regexp ^[0-9]{4}$
customer_validation.zip.1.cy regexp ^[0-9]{4}$
customer_validation.zip.1.cz regexp ^[0-9]{3}s?[0-9]{2}$
customer_validation.zip.1.de regexp ^[0-9]{5}$
customer_validation.zip.1.ee regexp ^[0-9]{5}$
customer_validation.zip.1.es regexp ^[0-9]{5}$
customer_validation.zip.1.fi regexp ^[0-9]{5}$
customer_validation.zip.1.fr regexp ^[0-9]{5}$
customer_validation.zip.1.gr regexp ^[0-9]{3}s?[0-9]{2}$
customer_validation.zip.1.hr regexp ^[0-9]{5}$
customer_validation.zip.1.hu regexp ^[0-9]{4}$
customer_validation.zip.1.ie regexp .*
customer_validation.zip.1.it regexp ^[0-9]{5}$
customer_validation.zip.1.lt regexp ^(LT-|lt-)?[0-9]{5}$
customer_validation.zip.1.lu regexp ^[0-9]{5}$
customer_validation.zip.1.lv regexp ^(LV-|lv-)[0-9]{4}$
customer_validation.zip.1.mt regexp ^[a-zA-Z]{3}s{1}[0-9]{4}$
customer_validation.zip.1.nl regexp ^[1-9][0-9]{3}(s)?(?!SS|ss|SA|sa|SD|sd)[a-zA-Z]{2}$
customer_validation.zip.1.pl regexp ^[0-9]{2}-?[0-9]{3}$
customer_validation.zip.1.pt regexp ^[0-9]{4}[-s]?[0-9]{3}$
customer_validation.zip.1.ro regexp ^[0-9]{6}$
customer_validation.zip.1.se regexp ^([0-9]{3})s?([0-9]{2})$ (replace: $1$2)
customer_validation.zip.1.si regexp ^(SI-|si-)?[0-9]{4}$
customer_validation.zip.1.sk regexp ^[0-9]{3}s?[0-9]{2}$

# ZIP, Denmark. Three digit Faroe Island codes purposefully not included.
customer_validation.zip.1.dk regexp ^(((DK|dk)(-| |))?d{4})$

# ZIP, UK
# Based on the rules from Royal Mail Programmers' Guide Edition 7, version 5.0 (p. 17-18)
customer_validation.zip.1.gb regexp ^(GIR 0AA)|((([A-PR-UWYZ][0-9]{1,2})|([A-PR-UWYZ][A-HK-Y][0-9]{1,2})|([A-PR-UWYZ][0-9][A-HJKPSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][A-Z])) [0-9][ABD-HJLNP-UWXYZ]{2})$

# Zip, Norway, Argentina, United States, Canada and Bermuda
customer_validation.zip.1.no regexp ^[0-9]{4}$ 
customer_validation.zip.1.ar regexp ^([a-zA-Z]{1})?[0-9]{4}([a-zA-Z]{3})?$ 
customer_validation.zip.1.us regexp ^[0-9]{5}(?:-[0-9]{4})?$ 
customer_validation.zip.1.ca regexp ^(?!.*[DFIOQU])[A-VXY][0-9][A-Z]?[0-9][A-Z][0-9]$ 
customer_validation.zip.1.bm regexp ^[a-zA-Z]{2} (([a-zA-Z]{2}|[0-9]{2}))$

# Identity number, default
customer_validation.identity_number.1.default regexp ^([^{}[]`=<>^;]*)$

# Identity number, country specific
customer_validation.identity_number.1.se regexp ^[0-9]{6}-[0-9]{4}$
customer_validation.identity_number.1.no regexp ^[0-9]{6}-?[0-9]{5}$

# Identity number, requirement for .se
customer_validation.identity_number.2.se.default.DMN-SE regexp.required ^[0-9]{6}-[0-9]{4}$

# Identity number, requirement for .nu
customer_validation.identity_number.3.se.default.DMN-NU regexp.required ^[0-9]{6}-[0-9]{4}$

# Identity number, requirement for .asia
customer_validation.identity_number.2.default.default.DMN-ASIA regexp.required .+

# Identity number, requirement for .au
customer_validation.identity_number.2.default.default.DMN-ORGAU regexp.required .+
customer_validation.identity_number.2.default.default.DMN-ASNAU regexp.required .+
customer_validation.identity_number.2.default.default.DMN-COMAU regexp.required .+
customer_validation.identity_number.2.default.default.DMN-NETAU regexp.required .+
customer_validation.identity_number.2.default.default.DMN-IDAU regexp.required .+

# Identity number, requirement for .com.ar, .pt, .com.pt
customer_validation.identity_number.2.default.default.DMN-COMAR regexp.required .+
customer_validation.identity_number.2.default.default.DMN-COMPT regexp.required .+
customer_validation.identity_number.2.default.default.DMN-PT regexp.required .+

# Identity number, requirement for .com.br
customer_validation.identity_number.2.default.default.DMN-COMBR regexp.required .+

# Identity number, requirement for .fi, .my, .sg
customer_validation.identity_number.2.default.default.DMN-FI regexp.required .+
customer_validation.identity_number.2.default.default.DMN-MY regexp.required .+
customer_validation.identity_number.2.default.default.DMN-SG regexp.required .+

# Identity number, requirement for .hk
customer_validation.identity_number.2.default.default.DMN-HK regexp.required .+

# Identity number, requirement for .hu, .co.hu
customer_validation.identity_number.2.default.default.DMN-HU regexp.required .+
customer_validation.identity_number.2.default.default.DMN-COHU regexp.required .+

# Identity number, requirement for .lv, .com.lv
customer_validation.identity_number.2.default.default.DMN-LV regexp.required .+
customer_validation.identity_number.2.default.default.DMN-COMLV regexp.required .+

# Identity number, requirement for .no
customer_validation.identity_number.2.default.default.DMN-NO regexp.required .+

# Identity number, requirement for .ro, .com.ro
customer_validation.identity_number.2.default.default.DMN-RO regexp.required .+
customer_validation.identity_number.2.default.default.DMN-COMRO regexp.required .+

# Identity number, requirement for .ru
customer_validation.identity_number.2.default.default.DMN-RU regexp.required .+

# VAT, default
customer_validation.vat_number.1.default regexp ^([^{}[]`=<>^;]*)$

# VAT, EU (removes '-' and '.', country prefix optional) 
# Reference: http://ec.europa.eu/taxation_customs/vies/faqvies.do#item_11 
customer_validation.vat_number.1.at javascript function (val) { return /^(AT)?U[0-9]{8}$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.be javascript function (val) { return /^(BE)?0?[0-9]{9}$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.bg javascript function (val) { return /^(BG)?[0-9]{9,10}$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.cy javascript function (val) { return /^(CY)?[0-9]{8}[A-Z]$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.cz javascript function (val) { return /^(CZ)?[0-9]{8,10}$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.de javascript function (val) { return /^(DE)?[0-9]{9}$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.dk javascript function (val) { return /^(DK)?[0-9]{8}$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.ee javascript function (val) { return /^(EE)?[0-9]{9}$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.es javascript function (val) { return /^(ES)?[0-9A-Z][0-9]{7}[0-9A-Z]$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.fi javascript function (val) { return /^(FI)?[0-9]{8}$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.fr javascript function (val) { return /^(FR)?[0-9A-Z]{2}[0-9]{9}$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.gb javascript function (val) { return /^(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.gr javascript function (val) { return /^(EL|GR)?[0-9]{9}$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.hr javascript function (val) { return /^(HR)?[0-9]{11}$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.hu javascript function (val) { return /^(HU)?[0-9]{8}$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.ie javascript function (val) { return /^(IE)?(([0-9]{7}[A-Z]{1,2})|([0-9][A-Z0-9+*][0-9]{5}[A-Z]))$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.it javascript function (val) { return /^(IT)?[0-9]{11}$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.lt javascript function (val) { return /^(LT)?([0-9]{9}|[0-9]{12})$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.lu javascript function (val) { return /^(LU)?[0-9]{8}$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.lv javascript function (val) { return /^(LV)?[0-9]{11}$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.mt javascript function (val) { return /^(MT)?[0-9]{8}$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.nl javascript function (val) { return /^(NL)?[0-9]{9}B[0-9]{2}$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.pl javascript function (val) { return /^(PL)?[0-9]{10}$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.pt javascript function (val) { return /^(PT)?[0-9]{9}$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.ro javascript function (val) { return /^(RO)?[0-9]{2,10}$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.se javascript function (val) { return /^(SE)?[0-9]{12}$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.si javascript function (val) { return /^(SI)?[0-9]{8}$/.test(val.replace(/[-.?]/, "")); } 
customer_validation.vat_number.1.sk javascript function (val) { return /^(SK)?[0-9]{10}$/.test(val.replace(/[-.?]/, "")); } 

# VAT, requirement for .se, non-Swedish entities
# Does not apply to Sweden so override with more specific rule.
customer_validation.vat_number.2.se.default.DMN-SE javascript function (val) { return /^(SE)?[0-9]{12}$/.test(val.replace(/[-.?]/, "")); }
customer_validation.vat_number.2.default.default.DMN-SE regexp.required .+

# VAT, requirement for .nu, non-Swedish entities
# Does not apply to Sweden so override with more specific rule.
customer_validation.vat_number.3.se.default.DMN-NU javascript function (val) { return /^(SE)?[0-9]{12}$/.test(val.replace(/[-.?]/, "")); }
customer_validation.vat_number.3.default.default.DMN-NU regexp.required .+

# VAT, requirement for .com.ar, .pt, .com.pt
customer_validation.vat_number.2.default.default.DMN-COMAR regexp.required .+
customer_validation.vat_number.2.default.default.DMN-COMPT regexp.required .+
customer_validation.vat_number.2.default.default.DMN-PT regexp.required .+

# VAT, requirement for .dk
customer_validation.vat_number.2.default.default.DMN-DK regexp.required .+

# VAT, requirement for .hu
customer_validation.vat_number.2.default.default.DMN-HU regexp.required .+
customer_validation.vat_number.2.default.default.DMN-COHU regexp.required .+

# VAT, requirement for .it
customer_validation.vat_number.2.default.default.DMN-IT regexp.required .+

# VAT, requirement for .lv, .com.lv
customer_validation.vat_number.2.default.default.DMN-LV regexp.required .+
customer_validation.vat_number.2.default.default.DMN-COMLV regexp.required .+

# VAT, requirement for .ro, .com.ro
customer_validation.vat_number.2.default.default.DMN-RO regexp.required .+
customer_validation.vat_number.2.default.default.DMN-COMRO regexp.required .+

# Country codes
customer_validation.country.1.default regexp ^[a-zA-Z]{2}$

# Phone, mobile and fax per country 
customer_validation.phone.1.default regexp ^+?([-.,/()s]?[0-9]){6,14}[-.,/()s]?[0-9]$ 
customer_validation.mobile.1.default regexp ^+?([-.,/()s]?[0-9]){6,14}[-.,/()s]?[0-9]$ 
customer_validation.fax.1.default regexp ^+?([-.,/()s]?[0-9]){6,14}[-.,/()s]?[0-9]$

# Custom fields
# custom_fields.<RuleSetNo>.<FieldName>.<CountryOption>.<ProductGroupOption>.<ProductOption>
# OpenSRS TLD requirements
# .us
custom_fields.1.nexus_app_purpose.default.default.DMN-US dropdown.required P1|P2|P3|P4|P5
custom_fields.1.nexus_category.default.default.DMN-US dropdown.required C11|C12|C21|C31|C32

# .aero
custom_fields.1.aero_ens_id.default.default.DMN-AERO regexp.required .+
custom_fields.1.aero_ens_password.default.default.DMN-AERO regexp.required .+

# .asia
custom_fields.1.id_type.default.default.DMN-ASIA dropdown.required passport|certificate|legislation|societyRegistry|politicalPartyRegistry
custom_fields.1.legal_entity_type.default.default.DMN-ASIA dropdown.required naturalPerson|corporation|cooperative|partnership|government|politicalParty|society|institution

# .org.au
custom_fields.1.eligibility_id.default.default.DMN-ORGAU regexp.required .+
custom_fields.1.eligibility_name.default.default.DMN-ORGAU regexp.required .+
custom_fields.1.eligibility_type.default.default.DMN-ORGAU dropdown.required Charity|Club|Incorporated Association|Non-profit Organization|Trade Union
custom_fields.1.eligibility_id_type.default.default.DMN-ORGAU dropdown.required ABN|ACT BN|NSW BN|NT BN|QLD BN|SA BN|TAS BN|VIC BN|WA BN|ACN|OTHER
custom_fields.1.policy_reason.default.default.DMN-ORGAU dropdown 1|2 (replace: 2)
custom_fields.1.registrant_id_type.default.default.DMN-ORGAU dropdown.required ACN|ABN
# .asn.au
custom_fields.1.eligibility_id.default.default.DMN-ASNAU regexp.required .+
custom_fields.1.eligibility_name.default.default.DMN-ASNAU regexp.required .+
custom_fields.1.eligibility_type.default.default.DMN-ASNAU dropdown.required Charity|Club|Incorporated Association|Non-profit Organization|Trade Union
custom_fields.1.eligibility_id_type.default.default.DMN-ASNAU dropdown.required ABN|ACT BN|NSW BN|NT BN|QLD BN|SA BN|TAS BN|VIC BN|WA BN|ACN|OTHER
custom_fields.1.policy_reason.default.default.DMN-ASNAU dropdown 1|2 (replace: 2)
custom_fields.1.registrant_id_type.default.default.DMN-ASNAU dropdown.required ACN|ABN
# .com.au
custom_fields.1.eligibility_id.default.default.DMN-COMAU regexp.required .+
custom_fields.1.eligibility_name.default.default.DMN-COMAU regexp.required .+
custom_fields.1.eligibility_type.default.default.DMN-COMAU dropdown.required Company|Partnership|Pending TM Owner|Registered Business|Trademark Owner
custom_fields.1.eligibility_id_type.default.default.DMN-COMAU dropdown.required ACN|ABN|OTHER|TM
custom_fields.1.policy_reason.default.default.DMN-COMAU dropdown 1|2 (replace: 2)
custom_fields.1.registrant_id_type.default.default.DMN-COMAU dropdown.required ACN|ABN
# .net.au
custom_fields.1.eligibility_id.default.default.DMN-NETAU regexp.required .+
custom_fields.1.eligibility_name.default.default.DMN-NETAU regexp.required .+
custom_fields.1.eligibility_type.default.default.DMN-NETAU dropdown.required Company|Partnership|Pending TM Owner|Registered Business|Trademark Owner
custom_fields.1.eligibility_id_type.default.default.DMN-NETAU dropdown.required ACN|ABN|OTHER|TM
custom_fields.1.policy_reason.default.default.DMN-NETAU dropdown 1|2 (replace: 2)
custom_fields.1.registrant_id_type.default.default.DMN-NETAU dropdown.required ACN|ABN
# .id.au
custom_fields.1.policy_reason.default.default.DMN-IDAU dropdown 1|2 (replace: 2)
custom_fields.1.registrant_id_type.default.default.DMN-IDAU dropdown.required ACN|ABN

# .coop
custom_fields.1.coop_verification_code.default.default.DMN-COOP regexp.required .+

# .fr
custom_fields.1.country_of_birth.default.default.DMN-FR regexp.required ^[A-Z]{2}$
custom_fields.1.place_of_birth.default.default.DMN-FR regexp.required .+
custom_fields.1.postal_code_of_birth.default.default.DMN-FR regexp.required .+
custom_fields.1.date_of_birth.default.default.DMN-FR regexp.required ^(19dd|20dd)-(0d|1[012])-([012]d|3[01])$

# .hk
custom_fields.1.date_of_birth.default.default.DMN-HK regexp.required ^(19dd|20dd)-(0d|1[012])-([012]d|3[01])$

# .it
custom_fields.1.entity_type.default.default.DMN-IT dropdown.required 1|2|3|4|5|6|7

# .jobs
custom_fields.1.jobs_association_member.default.default.DMN-JOBS dropdown.required Yes|No
custom_fields.1.jobs_website.default.default.DMN-JOBS regexp.required ^(https?://)?([da-z.-]+).([a-z.]{2,6})([/w .-]*)*/?$

# .pm
custom_fields.1.country_of_birth.default.default.DMN-PM regexp.required ^[A-Z]{2}$
custom_fields.1.place_of_birth.default.default.DMN-PM regexp.required .+
custom_fields.1.postal_code_of_birth.default.default.DMN-PM regexp.required .+
custom_fields.1.date_of_birth.default.default.DMN-PM regexp.required ^(19dd|20dd)-(0d|1[012])-([012]d|3[01])$
custom_fields.1.province_of_birth.default.default.DMN-PM regexp.required .+
# .re
custom_fields.1.country_of_birth.default.default.DMN-RE regexp.required ^[A-Z]{2}$
custom_fields.1.place_of_birth.default.default.DMN-RE regexp.required .+
custom_fields.1.postal_code_of_birth.default.default.DMN-RE regexp.required .+
custom_fields.1.date_of_birth.default.default.DMN-RE regexp.required ^(19dd|20dd)-(0d|1[012])-([012]d|3[01])$
custom_fields.1.province_of_birth.default.default.DMN-RE regexp.required .+
# .tf
custom_fields.1.country_of_birth.default.default.DMN-TF regexp.required ^[A-Z]{2}$
custom_fields.1.place_of_birth.default.default.DMN-TF regexp.required .+
custom_fields.1.postal_code_of_birth.default.default.DMN-TF regexp.required .+
custom_fields.1.date_of_birth.default.default.DMN-TF regexp.required ^(19dd|20dd)-(0d|1[012])-([012]d|3[01])$
custom_fields.1.province_of_birth.default.default.DMN-TF regexp.required .+
# .wf
custom_fields.1.country_of_birth.default.default.DMN-WF regexp.required ^[A-Z]{2}$
custom_fields.1.place_of_birth.default.default.DMN-WF regexp.required .+
custom_fields.1.postal_code_of_birth.default.default.DMN-WF regexp.required .+
custom_fields.1.date_of_birth.default.default.DMN-WF regexp.required ^(19dd|20dd)-(0d|1[012])-([012]d|3[01])$
custom_fields.1.province_of_birth.default.default.DMN-WF regexp.required .+
# .yt
custom_fields.1.country_of_birth.default.default.DMN-YT regexp.required ^[A-Z]{2}$
custom_fields.1.place_of_birth.default.default.DMN-YT regexp.required .+
custom_fields.1.postal_code_of_birth.default.default.DMN-YT regexp.required .+
custom_fields.1.date_of_birth.default.default.DMN-YT regexp.required ^(19dd|20dd)-(0d|1[012])-([012]d|3[01])$
custom_fields.1.province_of_birth.default.default.DMN-YT regexp.required .+

# .pro
custom_fields.1.profession.default.default.DMN-PRO regexp.required .+

# .ru
custom_fields.1.date_of_birth.default.default.DMN-RU regexp.required ^(19dd|20dd)-(0d|1[012])-([012]d|3[01])$
custom_fields.1.id_card_authority.default.default.DMN-RU regexp.required .+
custom_fields.1.id_card_issue_date.default.default.DMN-RU regexp.required ^(19dd|20dd)-(0d|1[012])-([012]d|3[01])$
custom_fields.1.place_of_birth.default.default.DMN-RU regexp.required .+

custom_fields.1.test_field1.default.default.DMN-TTT regexp ^([0-9]{3})s?([0-9]{2})$
custom_fields.2.test_field1.se.default.DMN-TTT regexp.required ^([0-9]{3})s?([0-9]{2})$ (replace: $1$2)

custom_fields.1.test_field2.default.default.DMN-TTT dropdown t1value1|t2value2|t3value3
custom_fields.2.test_field2.se.default.DMN-TTT dropdown.required t1value1|t2value2|t3value3 (replace: t2value2)

# Password requirements
# =====================
#
# The password requirements rules have option names like:
# password_requirements.<RuleName>.<Application>
#
# <Application> can be set to default (all applications), hcp (HostingControlPanel), bcup (BillingCustomerPanel), pop (PublicOrderPage) or admin (AdminPanel).
#
# Examples:
# password_requirements.email_account.default
# password_requirements.email_account.hcp
#
# All password requirements rules must have type regexp.
#

# Email account
password_requirements.email_account.default regexp ^.{8,20}$

# Note: If using TNAPI, the following rule should be used:
# password_requirements.email_account.default regexp ^(?=.{6,8}$)(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).*

# FTP account
password_requirements.ftp_account.default regexp ^.{8,20}$

# SSH account
password_requirements.ssh_account.default regexp (?=^.{8,255}$)((?=.*d)(?=.*[A-Z])(?=.*[a-z])|(?=.*d)(?=.*[^A-Za-z0-9])(?=.*[a-z])|(?=.*[^A-Za-z0-9])(?=.*[A-Z])(?=.*[a-z])|(?=.*d)(?=.*[A-Z])(?=.*[^A-Za-z0-9]))^.*

# MySQL user
password_requirements.mysql_user.default regexp ^.{8,20}$

# MSSQL user
password_requirements.mssql_user.default regexp ^(?=.{8,20}$)(?=.*d)(?=.*[a-z])(?=.*[A-Z]).*

# Website password protection
password_requirements.website_passwordprotection.default regexp ^.{8,20}$

# Exchange mailbox
password_requirements.exchange_mailbox.default regexp ^.{8,20}$

# Admin user
password_requirements.admin_user.default regexp ^(?=.{8,20}$)(?=.*d)(?=.*[a-z])(?=.*[A-Z]).*

#########

# TEST, internal type used for testing.
password_requirements.internal_test.default regexp ^default$
password_requirements.internal_test.hcp regexp ^hcp$

Keep in mind

To ensure that password regex is loaded from AtomiaConfigurationDefaults.txt for the FTP accounts page, you need to turn off the UseDefaultFTPPasswordRegex flag as explained below:

  • Find your Atomia Hosting Control Panel installation folder. It is usually located in: C:Program Files (x86)AtomiaHostingControlPanel
  • Open web.config file in your text editor
  • Find the UseDefaultFTPPasswordRegex app setting key and set its value to false.
  • Save the file to make changes active.

Was this helpful?