Page 1 of 1

Check length of text with space

Posted: June 15th, 2022, 4:03 am
by Arjun Brti
Dear team

How can I write the logic to check the space in a string field. For example if name of a person is John Deli, the enumerators must write the first name and last name like John<space> Deli, not JohnDeli with min length 5.

Thank you.

Regards,
Brti

Re: Check length of text with space

Posted: June 15th, 2022, 8:07 am
by Gregory Martin
There are a variety of ways you could do this, but one option is to use the regexmatch function: https://www.csprousers.org/help/CSPro/r ... ction.html

If you want to check for characters, a single space, more characters, and then optional spaces, you would use this regular expression: ^\S+\s\S+\s*$

You can test it here: https://regex101.com/r/wjkOp8/1