Capital Letters with Regex

507
3
Jump to solution
07-18-2021 05:36 AM
AlejandroMadrigal
New Contributor II

Hi Everyone!

I am using the following Regex in Survey123 Connect, in order to force a text, named Sector, to be written with Caps only, but it just doesn't work

regex(${Sector},'[A-Z\s]+')

the expression is placed on the constraint column.

Is it something I am doing wrong?

Thanks for your help.

 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Ruth_JiatengXu
Esri Contributor

Hi @AlejandroMadrigal 

Thanks for the response! Maybe you could try this regex(${Sector},'/[A-Z/s]/s')?

Besides, the input mask on the web app will be supported in the upcoming 3.13 release, you could try it now on our BETA website https://survey123beta.arcgis.com/

Thanks,

Ruth

View solution in original post

0 Kudos
3 Replies
Ruth_JiatengXu
Esri Contributor

Hi @AlejandroMadrigal ,

Thanks for sharing here! The regex you used is correct, and when the submit button is clicked, the invalid submission should be prevented, and the error msg should show up. If the behavior is not correct, please let us know.

I think what you are looking for is probably the input mask which prevents the invalid input. If you type >aaaaaaaa under the body::esri:inputMask field, all lowercase inputs will be transferred to uppercase.  https://doc.arcgis.com/en/survey123/desktop/create-surveys/esricustomcolumns.htm#ESRI_SECTION1_2D9AA...

Thanks,

Ruth

 

AlejandroMadrigal
New Contributor II

Thanks, Ruth

About the mask, it's a good solution, but I need it to work on the web as well, and I understand they don't in the web version.

I will double-check the regex, in order to see why is not working as it should

Thanks again

 

0 Kudos
Ruth_JiatengXu
Esri Contributor

Hi @AlejandroMadrigal 

Thanks for the response! Maybe you could try this regex(${Sector},'/[A-Z/s]/s')?

Besides, the input mask on the web app will be supported in the upcoming 3.13 release, you could try it now on our BETA website https://survey123beta.arcgis.com/

Thanks,

Ruth

0 Kudos