Regex Constraint Problem - Full Name command

Hello guys!
I’ve been trying to pass a regex to get at least two names of a full name in my form. However, when I try to deploy my form, there is a message “No JSON object could be decoded”. If I remove my regex from constraint, the deployment works fine.
The question type is setted as text.

The regex command:
regex(.,’^(?!.{52,})[a-zA-Z\u00C0-\u017F.’-]{1,50}(?: [a-zA-Z\u00C0-\u017F.\ ‘-]{1,50})+$’)

I validated in many regex testers, as https://regexr.com/, and worked fine.
Please, if someone could help me, I appreciate.
Thank you!

Hi @daniellc,

Welcome to the community! Could you kindly let us know what you intend to see or enter in your survey form (e.g. the name you wish to enter) so that we could help you figure out the issue.

GOOD DAY!

Hello, Kal!
I want to enter at least two names (latin character available). For example (without quotes):
Accept:
1- “Kal Lam”
2- "Kal Lam " (with space)
3- “Dan Ricardo”

Does not accept:
1- “Kal”
2-"Kal "

Thank you!

1 Like

Try this regex:

regex(. '^[A-Za-z]+ [A-Za-z]+[ ]{0,1}$')

Note, it wasn’t clear if you permit more than one trailing space (the above regex permits only 1 at most). Ditto permitted number of separator spaces.

1 Like

Hi @daniellc,

You could also do it as shown in the image below:

In the survey tab of the xlsform:

Refrence xlsform:
Regex_Constraint.xlsx (10.0 KB)