Expand my Community achievements bar.

SOLVED

Validating form fields with regular expression

Avatar

Level 2

Hi, 

I am creating an adaptive form in AEM based on an XDP file. I am having the general problem of understanding the format the validation patterns need to be in. Adobe Designer, where I create the XDP files, seems to have it's own pattern format -

E.G. "text{'('999')' 999-9999}" for validating a US phone number and 'text{OOOOOOOO'@example.com'}" to validate an email (this does not even work)

Unfortunately, all the built-in examples, as well as the examples in the documentation are based on a set number of characters. I would like to correctly validate all fields (email etc) and also text fields which can have an unlimited number of characters but only have a-z/A-Z characters. I am not able to define that correctly in Designer and also not in AEM on the form field field itself. It says "Regular Expression are permitted." but this seems to be incorrect.

Can someone shed some light on the general validation that is being done in that weird format? 

Any help would be greatly appreciated. 

Thanks. Alex

1 Accepted Solution

Avatar

Correct answer by
Employee

'text{OOOOOOOO'@example.com'} 

The above would work if and only if you write an 8 character string and nothing else. This special regex (its not exactly regex) is part of XFA spec and you can study about googling XFA spec.  

I can suggest a simple way that is to write a validation expression that returns true or false if you want validations for the field. 

View solution in original post

1 Reply

Avatar

Correct answer by
Employee

'text{OOOOOOOO'@example.com'} 

The above would work if and only if you write an 8 character string and nothing else. This special regex (its not exactly regex) is part of XFA spec and you can study about googling XFA spec.  

I can suggest a simple way that is to write a validation expression that returns true or false if you want validations for the field.