Hey all!
Hopefully this is a really easy question to answer: I have a form on Survey123 Connect and need to have a user enter an email address as a part of the form. The people filling out the survey do not have ArcOnline accounts, so they have to enter in a valid email address. I've tried entering the following regex string into the "constraint" field, but it doesn't seem to work:
regex(., '^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$')
See my screenshot for the other fields' values. Any ideas on what I'm doing wrong?
I added the following in the constraint of a text field and it seems to be working fine:
regex(., '^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$')
Quite odd. It's not showing any error in Survey123 Connect (if I start typing an email but don't complete it), but when I publish, it does what it's supposed to. In the same form but different field, the opposite is happening: I have a phone number field with an input mask ( (999)999-9999 ) and it shows/works correctly in Survey123 Connect, but after it's published and viewed online, it doesn't work correctly. Any ideas?
Got it. I'm on a desktop, and apparently input masks only work with the Field App. Used a constraint instead. Would really like to have the dashes automatically input, but this may work.
regex is such a mysterious beast to me so I am so grateful for those kind enough to share expressions! I am using this and it seems to be working like a charm. Thank you!
I'm using Survey123 Connect 3.14.261, and it's acting up with my regex code. Any ideas why? See how the text is showing in the field.